From ca0675d20d07737b15d75bdd4b6568f3be049a37 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 23 Feb 2010 22:12:22 +0000 Subject: [PATCH] fix sys.path issues within finding implicit modules using module() or mainModule() --- direct/src/p3d/ppackage.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/direct/src/p3d/ppackage.py b/direct/src/p3d/ppackage.py index c93f3e1adb..1c84f43b44 100755 --- a/direct/src/p3d/ppackage.py +++ b/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'