diff --git a/test/bytecode_2.7/01_rel_import.pyc b/test/bytecode_2.7/01_rel_import.pyc new file mode 100644 index 00000000..46c146da Binary files /dev/null and b/test/bytecode_2.7/01_rel_import.pyc differ diff --git a/test/simple_source/stmts/01_rel_import.py b/test/simple_source/stmts/01_rel_import.py new file mode 100644 index 00000000..77293b59 --- /dev/null +++ b/test/simple_source/stmts/01_rel_import.py @@ -0,0 +1,2 @@ +# Tests relative imports +from . import bogus diff --git a/uncompyle6/scanners/scanner2.py b/uncompyle6/scanners/scanner2.py index 7616d9a9..1b6463f2 100644 --- a/uncompyle6/scanners/scanner2.py +++ b/uncompyle6/scanners/scanner2.py @@ -301,7 +301,7 @@ class Scanner2(Scanner): j = self.offset2inst_index[offset] target_index = self.offset2inst_index[target] is_continue = (self.insts[target_index-1].opname == 'SETUP_LOOP' - and self.insts[j+1].opname == 'JUMP_FORWARD') and False + and self.insts[j+1].opname == 'JUMP_FORWARD') if is_continue: op_name = 'CONTINUE' if (offset in self.stmts and diff --git a/uncompyle6/semantics/pysource.py b/uncompyle6/semantics/pysource.py index f46176f7..1ec7adc0 100644 --- a/uncompyle6/semantics/pysource.py +++ b/uncompyle6/semantics/pysource.py @@ -1024,7 +1024,7 @@ class SourceWalker(GenericASTTraversal, object): def n_import_from(self, node): relative_path_index = 0 if self.version >= 2.5: - if node[relative_path_index].attr > 0: + if node[relative_path_index].pattr > 0: node[2].pattr = ('.' * node[relative_path_index].pattr) + node[2].pattr if self.version > 2.7: if isinstance(node[1].pattr, tuple):