[Python-modules-commits] [cherrypy3] 06/08: unrepr also from	__builtin__
    Carl Suster 
    arcresu-guest at moszumanska.debian.org
       
    Thu Jan 12 07:35:14 UTC 2017
    
    
  
This is an automated email from the git hooks/post-receive script.
arcresu-guest pushed a commit to branch master
in repository cherrypy3.
commit 09b76eb0d3b9f1544bb5d6f57d91a715585ae918
Author: Carl Suster <carl at contraflo.ws>
Date:   Fri Jan 6 20:21:51 2017 +1100
    unrepr also from __builtin__
    
    The Python2 tests are failing because __import__ is not found either as
    a module or inside the module "builtins". According to the docs at
    https://docs.python.org/2/library/functions.html#__import__ this
    function is instead inside the module "__builtin__".
    
    This patch makes unrepr also look for the name inside __builtin__ so
    that it can find __import__. It is not clear why this works upstream but
    not in Debian.
---
 cherrypy/lib/reprconf.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/cherrypy/lib/reprconf.py b/cherrypy/lib/reprconf.py
index 2553292..0e380b5 100644
--- a/cherrypy/lib/reprconf.py
+++ b/cherrypy/lib/reprconf.py
@@ -321,6 +321,11 @@ class _Builder2:
             return getattr(builtins, name)
         except AttributeError:
             pass
+        try:
+            import __builtin__
+            return getattr(__builtin__, name)
+        except AttributeError:
+            pass
 
         raise TypeError('unrepr could not resolve the name %s' % repr(name))
 
@@ -465,6 +470,11 @@ class _Builder3:
             return getattr(builtins, name)
         except AttributeError:
             pass
+        try:
+            import __builtin__
+            return getattr(__builtin__, name)
+        except AttributeError:
+            pass
 
         raise TypeError('unrepr could not resolve the name %s' % repr(name))
 
-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/cherrypy3.git
    
    
More information about the Python-modules-commits
mailing list