Commits

Ronny Pfannschmidt committed 4a92cc1

disable introspection magic on modules, so apipkg&co will work well

Comments (0)

Files changed (1)

bpython/inspection.py

         # original methods. :-(
         # The upshot being that introspecting on an object to display its
         # attributes will avoid unwanted side-effects.
-        if py3 or type_ != types.InstanceType:
+        patchable = py3 or type_ != types.InstanceType
+        # we are a bit evil and allow sideeffects on module
+        # this helps stuff like apipkg
+        a_module = issubclass(type_, types.ModuleType)
+        if patchable and not a_module:
             __getattr__ = getattr(type_, '__getattr__', None)
             if __getattr__ is not None:
                 try: