#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 __future__ import unicode_literals
from past.builtins import basestring
from ._utils import basestring from ._utils import basestring
from .nodes import ( from .nodes import (

View File

@ -1,5 +1,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from builtins import str
from past.builtins import basestring
from .dag import get_outgoing_edges, topo_sort from .dag import get_outgoing_edges, topo_sort
from functools import reduce from functools import reduce
from ._utils import basestring from ._utils import basestring

View File

@ -1,10 +1,12 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from builtins import str
from past.builtins import basestring
import hashlib import hashlib
import sys import sys
if sys.version_info.major == 2: if sys.version_info.major == 2:
# noinspection PyUnresolvedReferences,PyShadowingBuiltins # noinspection PyUnresolvedReferences,PyShadowingBuiltins
str = unicode str = str
# `past.builtins.basestring` module can't be imported on Python3 in some environments (Ubuntu). # `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): def get_incoming_edges(downstream_node, incoming_edge_map):
edges = [] 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 upstream_node, upstream_label, upstream_selector = upstream_info
edges += [DagEdge(downstream_node, downstream_label, upstream_node, upstream_label, upstream_selector)] edges += [DagEdge(downstream_node, downstream_label, upstream_node, upstream_label, upstream_selector)]
return edges return edges
@ -97,7 +97,7 @@ class KwargReprNode(DagNode):
@property @property
def __upstream_hashes(self): def __upstream_hashes(self):
hashes = [] 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 upstream_node, upstream_label, upstream_selector = upstream_info
hashes += [hash(x) for x in [downstream_label, upstream_node, upstream_label, upstream_selector]] hashes += [hash(x) for x in [downstream_label, upstream_node, upstream_label, upstream_selector]]
return hashes return hashes

View File

@ -1,5 +1,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from past.builtins import basestring
from .dag import KwargReprNode from .dag import KwargReprNode
from ._utils import escape_chars, get_hash_int from ._utils import escape_chars, get_hash_int
from builtins import object from builtins import object

View File

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