Commits

Alex Grönholm  committed f1e2d8d

Fixed TypeError when trying to raise LookupError on Python 3 (fixes #10)

  • Participants
  • Parent commits e7c73f1

Comments (0)

Files changed (2)

File paste/deploy/compat.py

     from ConfigParser import ConfigParser
     from urllib import unquote
     iteritems = lambda d: d.iteritems()
+    dictkeys = lambda d: d.keys()
 
     def reraise(t, e, tb):
         exec('raise t, e, tb', dict(t=t, e=e, tb=tb))
     from configparser import ConfigParser
     from urllib.parse import unquote
     iteritems = lambda d: d.items()
+    dictkeys = lambda d: list(d.keys())
 
     def reraise(t, e, tb):
         exec('raise e from tb', dict(e=e, tb=tb))

File paste/deploy/loadwsgi.py

 
 import pkg_resources
 
-from paste.deploy.compat import ConfigParser, unquote, iteritems
+from paste.deploy.compat import ConfigParser, unquote, iteritems, dictkeys
 from paste.deploy.util import fix_call, lookup_object
 
 __all__ = ['loadapp', 'loadserver', 'loadfilter', 'appconfig']
                    dist.location,
                    ', '.join(_flatten(object_type.egg_protocols)),
                    ', '.join(_flatten([
-                (pkg_resources.get_entry_info(self.spec, prot, name) or {}).keys()
+                dictkeys(pkg_resources.get_entry_info(self.spec, prot, name) or {})
                 for prot in protocol_options] or '(no entry points)'))))
         if len(possible) > 1:
             raise LookupError(