8000 #17: fix python 3 support · equalent/ffmpeg-python@662c56e · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 662c56e

Browse files
committed
kkroening#17: fix python 3 support
1 parent b548092 commit 662c56e

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

ffmpeg/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import unicode_literals
2+
23
from . import _filters, _ffmpeg, _run
34
from ._filters import *
45
from ._ffmpeg import *
56
from ._run import *
7+
68
__all__ = _filters.__all__ + _ffmpeg.__all__ + _run.__all__

ffmpeg/_ffmpeg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from __future__ import unicode_literals
2+
23
from .nodes import (
34
filter_operator,
45
GlobalNode,

ffmpeg/_filters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from __future__ import unicode_literals
2+
23
from .nodes import (
34
FilterNode,
45
filter_operator,

ffmpeg/_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import hashlib
1+
from __future__ import unicode_literals
2+
3+
from builtins import str
4+
from past.builtins import basestring
5+
import hashlib
26

37

48
def _recursive_repr(item):

ffmpeg/dag.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import unicode_literals
2+
13
from ._utils import get_hash, get_hash_int
24
from builtins import object
35
from collections import namedtuple
@@ -72,14 +74,14 @@ def incoming_edge_map(self):
7274

7375
def get_incoming_edges(downstream_node, incoming_edge_map):
7476
edges = []
75-
for downstream_label, (upstream_node, upstream_label) in incoming_edge_map.items():
77+
for downstream_label, (upstream_node, upstream_label) in list(incoming_edge_map.items()):
7678
edges += [DagEdge(downstream_node, downstream_label, upstream_node, upstream_label)]
7779
return edges
7880

7981

8082
def get_outgoing_edges(upstream_node, outgoing_edge_map):
8183
edges = []
82-
for upstream_label, downstream_infos in outgoing_edge_map.items():
84+
for upstream_label, downstream_infos in list(outgoing_edge_map.items()):
8385
for (downstream_node, downstream_label) in downstream_infos:
8486
edges += [DagEdge(downstream_node, downstream_label, upstream_node, upstream_label)]
8587
return edges
@@ -91,7 +93,7 @@ class KwargReprNode(DagNode):
9193
@property
9294
def __upstream_hashes(self):
9395
hashes = []
94-
for downstream_label, (upstream_node, upstream_label) in self.incoming_edge_map.items():
96+
for downstream_label, (upstream_node, upstream_label) in list(self.incoming_edge_map.items()):
9597
hashes += [hash(x) for x in [downstream_label, upstream_node, upstream_label]]
9698
return hashes
9799

ffmpeg/nodes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import unicode_literals
22

3+
from builtins import object
34
from .dag import KwargReprNode
45
from ._utils import get_hash_int
56

@@ -49,7 +50,7 @@ def __check_input_len(cls, stream_map, min_inputs, max_inputs):
4950

5051
@classmethod
5152
def __check_input_types(cls, stream_map, incoming_stream_types):
52-
for stream in stream_map.values():
53+
for stream in list(stream_map.values()):
5354
if not _is_of_types(stream, incoming_stream_types):
5455
raise TypeError('Expected incoming stream(s) to be of one of the following types: {}; got {}'
5556
.format(_get_types_str(incoming_stream_types), type(stream)))
@@ -69,7 +70,7 @@ def __get_stream_map(cls, stream_spec):
6970
@classmethod
7071
def __get_incoming_edge_map(cls, stream_map):
7172
incoming_edge_map = {}
72-
for downstream_label, upstream in stream_map.items():
73+
for downstream_label, upstream in list(stream_map.items()):
7374
incoming_edge_map[downstream_label] = (upstream.node, upstream.label)
7475
return incoming_edge_map
7576

0 commit comments

Comments
 (0)
0