Issue94

Title when recursing,use local libs first - patch
Priority bug Status resolved
Superseder Nosy List h4ck3rm1k3, kayhayen
Assigned To kayhayen Keywords wrong_execution

Created on 2013-06-19.00:56:31 by h4ck3rm1k3, last changed by kayhayen.

Messages
msg385 (view) Author: kayhayen Date: 2013-06-30.07:09:41
Released as 0.4.4
msg376 (view) Author: kayhayen Date: 2013-06-20.06:43:07
Pushed the patch to factory, where it's still subject to re-writing and
re-basing, so let me know, if I got anything wrong there.

I expect it to be part of the next pre-release or release on the weekend.

Thanks a lot for your patch, very much appreciated.
msg375 (view) Author: kayhayen Date: 2013-06-19.08:18:55
Hello,

this looks like a really good catch. I was checking importing, and there, it's 
done properly. But this is about recursion, so Nuitka would not recurse to your 
module potentially, and so later on, the original module is used.

I therefore consider this a bug.
msg374 (view) Author: h4ck3rm1k3 Date: 2013-06-19.00:56:31
This is a patch to allow me to override system libs, it is normal behaviour of
python, first the locals then the globals.
diff --git a/nuitka/Importing.py b/nuitka/Importing.py
index b930b5a..743fc87 100644
--- a/nuitka/Importing.py
+++ b/nuitka/Importing.py
@@ -147,7 +147,7 @@ def _findModuleInPath( module_name, package_name ):
         ext_path = [
             getPackageDirname( element )
             for element in
-            sys.path + extra_paths
+            extra_paths + sys.path 
             if isPackageDir( getPackageDirname( element ) )
         ]
 
@@ -174,7 +174,7 @@ def _findModuleInPath( module_name, package_name ):
             if _debug_module_finding:
                 print( "_findModuleInPath: imp.find_module failed with syntax
error" )
 
-    ext_path = sys.path + extra_paths
+    ext_path = extra_paths + sys.path 
 
     if _debug_module_finding:
         print( "_findModuleInPath: Non-package, using extended path", ext_path )
History
Date User Action Args
2013-06-30 07:09:41kayhayensetstatus: testing -> resolved
messages: + msg385
2013-06-20 06:43:07kayhayensetmessages: + msg376
title: patch : use local libs first -> when recursing,use local libs first - patch
2013-06-19 08:18:55kayhayensetstatus: unread -> testing
keyword: + wrong_execution
nosy: + kayhayen
messages: + msg375
priority: wish -> bug
assignedto: kayhayen
2013-06-19 00:56:31h4ck3rm1k3create