[Pyobjc-dev] objc & sys.path munging
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2002-11-19 09:17:39
|
Here's a snippet from objc.__init__.py: # This is a hack, should probably patch python: # - We want the resources directory to be on the python search-path # - It must be at the start of the path # - The CWD must not be on the path if 1 : b = lookup_class('NSBundle').mainBundle() if b: sys.path.insert(0, '%s/Contents/Resources'%str(b.bundlePath())) del b del sys, __builtin__ Questions: - "...should probably patch python", how? - why must it be at the start of the path? - why must the CWD not be on the path? I really think the adding of Contents/Resources to sys.path should be done elsewhere. It would be trivial to do so in the execve wrapper. I'd like to understand the issues... Just |