Commits

Anonymous committed 8e5691d

py3k support

  • Participants
  • Parent commits f422ac6

Comments (0)

Files changed (4)

 \.pyc$
 ^\.ropeproject$
 ~$
+\.egg-info/
+^build/
+^dist/

File fixes/__init__.py

Empty file added.

File fixes/fix_hasattrimfunc.py

+#-*- coding: utf-8 -*-
+
+from lib2to3.fixer_base import BaseFix
+
+
+class FixHasattrimfunc(BaseFix):
+
+    PATTERN = """\
+power< 'hasattr' trailer< '(' arglist< any ',' name="'im_func'"> ')' > > any*
+"""
+
+    def transform(self, node, results):
+        name = results['name']
+        name.value = "'__func__'"
+        name.changed()
+
+
+# dependencies for python 2 or python 3
+import sys
+if sys.version < '3':
+    install_requires = ['rope >= 0.9.4', 'ropemode >= 0.2']
+else:
+    install_requires = ['rope_py3k >= 0.9.4', 'ropemode >= 0.2']
+
+
 extra_kwargs = {}
 try:
     from setuptools import setup
-    extra_kwargs['install_requires'] = ['rope >= 0.9.4', 'ropemode >= 0.2']
+    extra_kwargs['install_requires'] = install_requires
 except ImportError:
     from distutils.core import setup
 
       license='GNU GPL',
       classifiers=classifiers,
       requires=['ropemode'],
+      use_2to3=True,
+      use_2to3_fixers=['fixes'],
       **extra_kwargs)