Commits

Anonymous committed 6993f35

Fixed: MakeComServer needs to import PyInstaller.makespec. Did this
ever work since moving code into PyInstaller/*.py?

git-svn-id: file:///tmp/pyinstaller-svn/trunk@1640 6d373633-9ee7-468a-befa-14b9e37bb2df

Comments (0)

Files changed (1)

utils/MakeComServer.py

 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
-import os, sys, win32api, Makespec
+try:
+    import PyInstaller
+except ImportError:
+    # if importing PyInstaller fails, try to load from current
+    # directory or parent directory to support running without
+    # installation
+    import imp, os
+    if not hasattr(os, 'getuid') or os.getuid() != 0:
+        imp.load_module('PyInstaller', *imp.find_module('PyInstaller',
+            [os.path.dirname(os.path.dirname(__file__))]))
+
+import PyInstaller.makespec as makespec
+
+import os, sys, win32api
 
 import optparse
 
     outf.close()
     print "**********************************"
     print "Driver script %s created" % outfnm
-    specfnm = Makespec.main([outfnm], console=debug, debug=debug,
+    specfnm = makespec.main([outfnm], console=debug, debug=debug,
                             workdir=workdir, pathex=paths, comserver=1, ascii=ascii)
     print "Spec file %s created" % specfnm