Ronald Oussoren avatar Ronald Oussoren committed 40090c7

Fix problem with plugin bundles caused by recent changes.

Comments (0)

Files changed (2)

py2app/bootstrap/boot_aliasplugin.py

     global __file__
     import os, site
     sys.frozen = 'macosx_plugin'
+    base = os.environ['RESOURCEPATH']
 
     if 'ARGVZERO' in os.environ:
         argv0 = os.path.basename(os.environ['ARGVZERO'])
         argv0 = None
     script = SCRIPT_MAP.get(argv0, DEFAULT_SCRIPT)
 
-    sys.argv[0] = __file__ = script
+    sys.argv[0] = __file__ = path = os.path.join(base, script)
     if sys.version_info[0] == 2:
-        with open(script, 'rU') as fp:
+        with open(path, 'rU') as fp:
             source = fp.read() + "\n"
     else:
-        with open(script, 'rb') as fp:
+        with open(path, 'rb') as fp:
             encoding = guess_encoding(fp)
 
-        with open(script, 'r', encoding=encoding) as fp:
+        with open(path, 'r', encoding=encoding) as fp:
             source = fp.read() + '\n'
 
     exec(compile(source, script, 'exec'), globals(), globals())

py2app/bootstrap/boot_plugin.py

 
     __file__ = path = os.path.join(base, script)
     if sys.version_info[0] == 2:
-        with open(script, 'rU') as fp:
+        with open(path, 'rU') as fp:
             source = fp.read() + "\n"
     else:
-        with open(script, 'rb') as fp:
+        with open(path, 'rb') as fp:
             encoding = guess_encoding(fp)
 
-        with open(script, 'r', encoding=encoding) as fp:
+        with open(path, 'r', encoding=encoding) as fp:
             source = fp.read() + '\n'
 
     exec(compile(source, path, 'exec'), globals(), globals())
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.