Commits

Anselm Kruis committed 3167466

Fixed a compatibility probelm with virtualenv.

  • Participants
  • Parent commits 876535c

Comments (0)

Files changed (1)

Lib/distutils/__init__.py

             except Exception:
                 einfo = exc_info()
                 raise ImportError, "Failed to exec file '%s' with exception: %s" % (pathname, einfo[1]), einfo[2]
+            else:
+                i = __path__.index(path[0])
+                if i > 0:
+                    # bring our dir to the front again. Required for virtualenv
+                    del __path__[i]
+                    __path__.insert(0, path[0])
         finally:
             file.close()