timothycrosley / deprecated.pies

The simplest (and tastiest) way to write one program that runs on both Python 2 and Python 3.
MIT License
148 stars 7 forks source link

AttributeError: 'module' object has no attribute '_InstanceType' #16

Closed lithammer closed 10 years ago

lithammer commented 10 years ago
Python 2.6.5 (r265:79063, Jul 14 2010, 11:36:05)
[GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import abc
>>> getattr(abc, '_InstanceType')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '_InstanceType'

Seems like _InstanceType isn't available in Python 2.6.

Stumpled upon this while trying to run frosted on some of my Python files:

Traceback (most recent call last):
  File "/usr/bin/frosted", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.6/site-packages/frosted/main.py", line 33, in main
    warnings = check_recursive(file_names, **arguments)
  File "/usr/lib/python2.6/site-packages/frosted/api.py", line 124, in check_recursive
    warnings += check_path(source_path, reporter, settings_path=None, **setting_overrides)
  File "/usr/lib/python2.6/site-packages/frosted/api.py", line 105, in check_path
    return check(codestr, filename, reporter, settings_path, **setting_overrides)
  File "/usr/lib/python2.6/site-packages/frosted/api.py", line 86, in check
    w = checker.Checker(tree, filename, None, **active_settings)
  File "/usr/lib/python2.6/site-packages/frosted/checker.py", line 264, in __init__
    self.handle_children(tree)
  File "/usr/lib/python2.6/site-packages/frosted/checker.py", line 517, in handle_children
    self.handleNode(node, tree)
  File "/usr/lib/python2.6/site-packages/frosted/checker.py", line 550, in handleNode
    handler(node)
  File "/usr/lib/python2.6/site-packages/frosted/checker.py", line 853, in IMPORT
    self.add_binding(node, importation)
  File "/usr/lib/python2.6/site-packages/frosted/checker.py", line 398, in add_binding
    if not isinstance(self.scope, ClassScope):
  File "/usr/lib/python2.6/site-packages/pies/_utils.py", line 68, in __instancecheck__
    if subtype is abc._InstanceType:
AttributeError: 'module' object has no attribute '_InstanceType'

frosted==1.3.2 pies==2.5.5 pies2overrides==2.5.5

timothycrosley commented 10 years ago

Thanks for reporting! I will be working on a hotfix release to address this issue. ~Tim

timothycrosley commented 10 years ago

Fixed in version 2.6.0,

Thanks again for reporting!

~Tim