changeset 10104:e533fc8a058b

Merge with stable
author Sune Foldager <cryo@cyanite.org>
date Mon, 21 Dec 2009 16:13:20 +0100
parents 1720d70cd6d4 (current diff) 37679dbf2ee3 (diff)
children dc5b5cc5ca34
files
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hook.py	Sun Dec 20 17:18:04 2009 +0100
+++ b/mercurial/hook.py	Mon Dec 21 16:13:20 2009 +0100
@@ -27,13 +27,13 @@
             raise util.Abort(_('%s hook is invalid ("%s" not in '
                                'a module)') % (hname, funcname))
         modname = funcname[:d]
-        oldpaths = sys.path[:]
+        oldpaths = sys.path
         if hasattr(sys, "frozen"):
             # binary installs require sys.path manipulation
-            path, name = os.path.split(modname)
-            if path and name:
-                sys.path.append(path)
-                modname = name
+            modpath, modfile = os.path.split(modname)
+            if modpath and modfile:
+                sys.path = sys.path[:] + [modpath]
+                modname = modfile
         try:
             obj = __import__(modname)
         except ImportError: