summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac/pimp.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-02-12 16:37:00 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-02-12 16:37:00 (GMT)
commite71b9f830b0a3829de799c6b826ea2b4450762c4 (patch)
tree6ee1cef39f577714a9bf544e01d6528d2b4a4e29 /Lib/plat-mac/pimp.py
parentc13f19f1fc70bfeb88c69d89cefd8494176c15b4 (diff)
downloadcpython-e71b9f830b0a3829de799c6b826ea2b4450762c4.zip
cpython-e71b9f830b0a3829de799c6b826ea2b4450762c4.tar.gz
cpython-e71b9f830b0a3829de799c6b826ea2b4450762c4.tar.bz2
- Use distutils to find site-python (suggested by Thomas Heller, thanks!)
- Fixed a bug for packages without MD5 checksum.
Diffstat (limited to 'Lib/plat-mac/pimp.py')
-rw-r--r--Lib/plat-mac/pimp.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py
index 2ca5369..84bee42 100644
--- a/Lib/plat-mac/pimp.py
+++ b/Lib/plat-mac/pimp.py
@@ -18,6 +18,7 @@ import urllib
import urlparse
import plistlib
import distutils.util
+import distutils.sysconfig
import md5
__all__ = ["PimpPreferences", "PimpDatabase", "PimpPackage", "main"]
@@ -33,12 +34,7 @@ PIMP_VERSION="0.1"
DEFAULT_FLAVORORDER=['source', 'binary']
DEFAULT_DOWNLOADDIR='/tmp'
DEFAULT_BUILDDIR='/tmp'
-for _p in sys.path:
- if _p[-13:] == 'site-packages':
- DEFAULT_INSTALLDIR=_p
- break
-else:
- DEFAULT_INSTALLDIR=sys.prefix # Have to put things somewhere
+DEFAULT_INSTALLDIR=distutils.sysconfig.get_python_lib()
DEFAULT_PIMPDATABASE="http://www.cwi.nl/~jack/pimp/pimp-%s.plist" % distutils.util.get_platform()
ARCHIVE_FORMATS = [
@@ -419,7 +415,7 @@ class PimpPackage:
if not os.path.exists(self.archiveFilename):
return 0
- if not self._dict['MD5Sum']:
+ if not self._dict.get('MD5Sum'):
sys.stderr.write("Warning: no MD5Sum for %s\n" % self.fullname())
return 1
data = open(self.archiveFilename, 'rb').read()