diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 47d2b3e7..8f8b501c 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -1,7 +1,6 @@ """ To ensure compatibility from Python ``2.6`` - ``3.3``, a module has been -created. Clearly there is huge need to use conforming syntax. But many changes -(e.g. ``property``, ``hasattr`` in ``2.5``) can be rewritten in pure python. +created. Clearly there is huge need to use conforming syntax. """ import sys import imp @@ -147,16 +146,13 @@ class Python3Method(object): else: return lambda *args, **kwargs: self.func(obj, *args, **kwargs) + def use_metaclass(meta, *bases): """ Create a class with a metaclass. """ if not bases: bases = (object,) return meta("HackClass", bases, {}) -try: - from functools import reduce # Python 3 -except ImportError: - reduce = reduce try: encoding = sys.stdout.encoding @@ -165,6 +161,7 @@ try: except AttributeError: encoding = 'ascii' + def u(string): """Cast to unicode DAMMIT! Written because Python2 repr always implicitly casts to a string, so we diff --git a/test/refactor.py b/test/refactor.py index fdbbdc20..ec360783 100755 --- a/test/refactor.py +++ b/test/refactor.py @@ -7,7 +7,7 @@ from __future__ import with_statement import os import re -from jedi._compatibility import reduce +from functools import reduce import jedi from jedi import refactoring diff --git a/test/run.py b/test/run.py index f0ff54e8..961a71c7 100755 --- a/test/run.py +++ b/test/run.py @@ -101,7 +101,8 @@ import re from ast import literal_eval import jedi -from jedi._compatibility import unicode, reduce, StringIO, is_py3k +from functools import reduce +from jedi._compatibility import unicode, StringIO, is_py3k TEST_COMPLETIONS = 0