소스 검색

fix sys.path issues within finding implicit modules using module() or mainModule()

David Rose 16 년 전
부모
커밋
ca0675d20d
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      direct/src/p3d/ppackage.py

+ 8 - 0
direct/src/p3d/ppackage.py

@@ -172,6 +172,14 @@ packageNames = None
 if len(args) > 1:
     packageNames = args[1:]
 
+# Add the directory containing the pdef file itself to sys.path, to
+# help the Packager locate modules where a pathname isn't specified.
+dirname = packageDef.getDirname()
+if dirname:
+    sys.path.append(Filename(dirname).toOsSpecific())
+else:
+    sys.path.append('.')
+
 if universalBinaries:
     if platforms:
         print '\nYou may not specify both -u and -P.\n'