#30: re-futurize

This commit is contained in:
Karl Kroening 2018-05-09 03:15:12 -05:00
parent 3e68bc8c9a
commit 84355d419c
6 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,6 @@
from __future__ import unicode_literals
from past.builtins import basestring
from ._utils import basestring
from .nodes import (

View File

@ -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

View File

@ -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).

View File

@ -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

View File

@ -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

View File

@ -1,5 +1,6 @@
from __future__ import unicode_literals
from builtins import str
from builtins import bytes
from builtins import range
import ffmpeg