[Pythonmac-SIG] Yet another problem with two Pythons on Panther
Stuart Bishop
stuart.b at commonground.com.au
Sat Dec 6 19:55:51 EST 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/12/2003, at 1:05 AM, Jack Jansen wrote:
> This could probably be fixed by adding a -F/System/Library/Frameworks
> to the builds, but I don't think we can do this for the existing
> 10.3/2.3 distribution. Or can someone think of a workaround?
Add /Library/Python/2.3/sitecustomize.py:
# Add a directory to the start of sys.path so we can override
# modules shipped with OSX without actually modifying anything in
# /System
import sys
if sys.version_info[:3] == (2, 3, 0):
sys.path.insert(0, '/Library/Python/2.3.0-patches')
Then stick a patched version of distutils in
/Library/Python/2.3.0-patches
to overshadow the real one.
Extra points for renaming any existing
/Library/Python/2.3/sitecustomize.py
and importing it at the end of the new one.
Hmmm.... I wonder if this gross and incredibly stupid hack would work?
/Library/Python/2.3/sitecustomize.py:
import sys, os
if sys.version_info == (2, 3, 0, 'final', 0):
# Relaunch with patch release Python
os.execl(
'/Library/Frameworks/Python.framework/Versions/2.3/bin/python',
sys.argv
)
:-)
- --
Stuart Bishop <stuart at stuartbishop.net>
http://www.stuartbishop.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQE/0nqbAfqZj7rGN0oRAqyyAJ9VEcWVzm0oMk5s5lzdzwjcWMJXkQCfX8Zo
1EXaCg08KTzDxj8R5CW0bNs=
=K4JU
-----END PGP SIGNATURE-----
More information about the Pythonmac-SIG
mailing list