diff --git a/ffmpeg/_ffmpeg.py b/ffmpeg/_ffmpeg.py index b73e998..7ea3be2 100644 --- a/ffmpeg/_ffmpeg.py +++ b/ffmpeg/_ffmpeg.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +from past.builtins import basestring from ._utils import basestring from .nodes import ( diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py index 4e5faf4..cec8bfb 100644 --- a/ffmpeg/_run.py +++ b/ffmpeg/_run.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals +from builtins import str +from past.builtins import basestring from .dag import get_outgoing_edges, topo_sort from functools import reduce from ._utils import basestring diff --git a/ffmpeg/_utils.py b/ffmpeg/_utils.py index 20eb1af..3514409 100644 --- a/ffmpeg/_utils.py +++ b/ffmpeg/_utils.py @@ -1,10 +1,12 @@ from __future__ import unicode_literals +from builtins import str +from past.builtins import basestring import hashlib import sys if sys.version_info.major == 2: # noinspection PyUnresolvedReferences,PyShadowingBuiltins - str = unicode + str = str # `past.builtins.basestring` module can't be imported on Python3 in some environments (Ubuntu). diff --git a/ffmpeg/dag.py b/ffmpeg/dag.py index 335a060..fb51c6a 100644 --- a/ffmpeg/dag.py +++ b/ffmpeg/dag.py @@ -75,7 +75,7 @@ DagEdge = namedtuple('DagEdge', ['downstream_node', 'downstream_label', 'upstrea def get_incoming_edges(downstream_node, incoming_edge_map): edges = [] - for downstream_label, upstream_info in incoming_edge_map.items(): + for downstream_label, upstream_info in list(incoming_edge_map.items()): upstream_node, upstream_label, upstream_selector = upstream_info edges += [DagEdge(downstream_node, downstream_label, upstream_node, upstream_label, upstream_selector)] return edges @@ -97,7 +97,7 @@ class KwargReprNode(DagNode): @property def __upstream_hashes(self): hashes = [] - for downstream_label, upstream_info in self.incoming_edge_map.items(): + for downstream_label, upstream_info in list(self.incoming_edge_map.items()): upstream_node, upstream_label, upstream_selector = upstream_info hashes += [hash(x) for x in [downstream_label, upstream_node, upstream_label, upstream_selector]] return hashes diff --git a/ffmpeg/nodes.py b/ffmpeg/nodes.py index e861822..46b7897 100644 --- a/ffmpeg/nodes.py +++ b/ffmpeg/nodes.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +from past.builtins import basestring from .dag import KwargReprNode from ._utils import escape_chars, get_hash_int from builtins import object diff --git a/ffmpeg/tests/test_ffmpeg.py b/ffmpeg/tests/test_ffmpeg.py index 3ad4113..c7805fa 100644 --- a/ffmpeg/tests/test_ffmpeg.py +++ b/ffmpeg/tests/test_ffmpeg.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals +from builtins import str from builtins import bytes from builtins import range import ffmpeg