This commit is contained in:
Karl Kroening 2017-07-12 02:10:44 -06:00
parent 7b2d8b63fc
commit 4640adabe0
3 changed files with 7 additions and 5 deletions

View File

@ -67,7 +67,7 @@ def _allocate_filter_stream_names(filter_nodes, outgoing_edge_maps, stream_name_
stream_count = 0 stream_count = 0
for upstream_node in filter_nodes: for upstream_node in filter_nodes:
outgoing_edge_map = outgoing_edge_maps[upstream_node] outgoing_edge_map = outgoing_edge_maps[upstream_node]
for upstream_label, downstreams in outgoing_edge_map.items(): for upstream_label, downstreams in list(outgoing_edge_map.items()):
if len(downstreams) > 1: if len(downstreams) > 1:
# TODO: automatically insert `splits` ahead of time via graph transformation. # TODO: automatically insert `splits` ahead of time via graph transformation.
raise ValueError('Encountered {} with multiple outgoing edges with same upstream label {!r}; a ' raise ValueError('Encountered {} with multiple outgoing edges with same upstream label {!r}; a '

View File

@ -54,7 +54,7 @@ def get_stream_map(stream_spec):
def get_stream_map_nodes(stream_map): def get_stream_map_nodes(stream_map):
nodes = [] nodes = []
for stream in stream_map.values(): for stream in list(stream_map.values()):
if not isinstance(stream, Stream): if not isinstance(stream, Stream):
raise TypeError('Expected Stream; got {}'.format(type(stream))) raise TypeError('Expected Stream; got {}'.format(type(stream)))
nodes.append(stream.node) nodes.append(stream.node)
@ -157,7 +157,7 @@ class FilterNode(Node):
out_args = [escape_chars(x, '\\\'=:') for x in args] out_args = [escape_chars(x, '\\\'=:') for x in args]
out_kwargs = {} out_kwargs = {}
for k, v in kwargs.items(): for k, v in list(kwargs.items()):
k = escape_chars(k, '\\\'=:') k = escape_chars(k, '\\\'=:')
v = escape_chars(v, '\\\'=:') v = escape_chars(v, '\\\'=:')
out_kwargs[k] = v out_kwargs[k] = v

View File

@ -1,5 +1,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from builtins import bytes
from builtins import range
import ffmpeg import ffmpeg
import os import os
import pytest import pytest
@ -171,7 +173,7 @@ def test_filter_normal_arg_escape():
'=': 2, '=': 2,
'\n': 0, '\n': 0,
} }
for ch, expected_backslash_count in expected_backslash_counts.items(): for ch, expected_backslash_count in list(expected_backslash_counts.items()):
expected = '{}{}'.format('\\' * expected_backslash_count, ch) expected = '{}{}'.format('\\' * expected_backslash_count, ch)
actual = _get_drawtext_font_repr(ch) actual = _get_drawtext_font_repr(ch)
assert expected == actual assert expected == actual
@ -205,7 +207,7 @@ def test_filter_text_arg_str_escape():
'=': 2, '=': 2,
'\n': 0, '\n': 0,
} }
for ch, expected_backslash_count in expected_backslash_counts.items(): for ch, expected_backslash_count in list(expected_backslash_counts.items()):
expected = '{}{}'.format('\\' * expected_backslash_count, ch) expected = '{}{}'.format('\\' * expected_backslash_count, ch)
actual = _get_drawtext_text_repr(ch) actual = _get_drawtext_text_repr(ch)
assert expected == actual assert expected == actual