- Use distutils to find site-python (suggested by Thomas Heller, thanks!)
- Fixed a bug for packages without MD5 checksum.
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 urlparse
 import plistlib
 import distutils.util
+import distutils.sysconfig
 import md5
 
 __all__ = ["PimpPreferences", "PimpDatabase", "PimpPackage", "main"]
@@ -33,12 +34,7 @@
 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 @@
 		
 		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()