Commits

Anonymous committed 5f39db5

don't crash when we're not really installing

Comments (0)

Files changed (1)

     import shutil
     inst = dist.get_command_obj("install")
     install_dir = inst.install_platlib
-    for name in ("objc", "Foundation", "AppKit", "AddressBook", "autoGIL"):
-        path = os.path.join(install_dir, name)
-        if os.path.isdir(path):
-            print "(removing old version: %s)" % path
-            shutil.rmtree(path)
-        elif os.path.isfile(path):
-            print "(removing old version: %s)" % path
-            os.remove(path)
+    if install_dir is not None:
+        for name in ("objc", "Foundation", "AppKit", "AddressBook", "autoGIL"):
+            path = os.path.join(install_dir, name)
+            if os.path.isdir(path):
+                print "(removing old version: %s)" % path
+                shutil.rmtree(path)
+            elif os.path.isfile(path):
+                print "(removing old version: %s)" % path
+                os.remove(path)