fix problem with empty import_paths

This commit is contained in:
David Halter
2012-12-30 10:32:11 +01:00
parent 41362370ed
commit 64465dae8d
+1
View File
@@ -151,6 +151,7 @@ class ImportPath(parsing.Base):
# sys.path. Therefore look if gunicorn is a parent directory, #56. # sys.path. Therefore look if gunicorn is a parent directory, #56.
parts = self.file_path.split(os.path.sep) parts = self.file_path.split(os.path.sep)
in_path = [] in_path = []
if self.import_path:
for i, p in enumerate(parts): for i, p in enumerate(parts):
if p == self.import_path[0]: if p == self.import_path[0]:
new = os.path.sep.join(parts[:i]) new = os.path.sep.join(parts[:i])