refactoring of a few tests

This commit is contained in:
David Halter committed 2012-12-09 21:38:39 +01:00
1 parent 830f50e314
commit 9dfa98c474
2 files changed
+25 -22

No files matched your search

+5 -4
View File
@@ -102,10 +102,11 @@ class ImportPath(parsing.Base):
if self.import_stmt.relative_count == 0:
names += self.get_module_names()
path = os.path.abspath(self.file_path)
for i in range(self.import_stmt.relative_count - 1):
path = os.path.dirname(path)
names += self.get_module_names([path])
if self.file_path is not None:
path = os.path.abspath(self.file_path)
for i in range(self.import_stmt.relative_count - 1):
path = os.path.dirname(path)
names += self.get_module_names([path])
else:
if on_import_stmt and isinstance(scope, parsing.Module) \
and scope.path.endswith('__init__.py'):