forked from VimPlug/jedi
Adding python 3.3 to test environment, mani fixes
Added python 3.3 to test-suite Removed unused import Removed unused import Migrated to EAFP for attribute checking Bumped version of ModulePickling for migration to hashlib Added py33 environment to tox Fixed issue with package importing on python 3.3
This commit is contained in:
@@ -4,6 +4,7 @@ env:
|
|||||||
- TOXENV=py26
|
- TOXENV=py26
|
||||||
- TOXENV=py27
|
- TOXENV=py27
|
||||||
- TOXENV=py32
|
- TOXENV=py32
|
||||||
|
- TOXENV=py33
|
||||||
install:
|
install:
|
||||||
- pip install --quiet --use-mirrors tox
|
- pip install --quiet --use-mirrors tox
|
||||||
script:
|
script:
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ will be dropped, we'll get rid of most code.
|
|||||||
import sys
|
import sys
|
||||||
import imp
|
import imp
|
||||||
import os
|
import os
|
||||||
import io
|
|
||||||
try:
|
try:
|
||||||
import importlib
|
import importlib
|
||||||
except:
|
except:
|
||||||
@@ -31,11 +30,14 @@ def find_module_py33(string, path=None):
|
|||||||
raise ImportError
|
raise ImportError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
filename = importing.get_filename(string)
|
if (importing.is_package(string)):
|
||||||
if filename and os.path.exists(filename):
|
returning = (None, os.path.dirname(importing.path), True)
|
||||||
returning = (open(filename, 'U'), filename, False)
|
|
||||||
else:
|
else:
|
||||||
returning = (None, filename, False)
|
filename = importing.get_filename(string)
|
||||||
|
if filename and os.path.exists(filename):
|
||||||
|
returning = (open(filename, 'U'), filename, False)
|
||||||
|
else:
|
||||||
|
returning = (None, filename, False)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
returning = (None, importing.load_module(string).__name__, False)
|
returning = (None, importing.load_module(string).__name__, False)
|
||||||
|
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ def save_module(path, name, parser, pickling=True):
|
|||||||
|
|
||||||
class _ModulePickling(object):
|
class _ModulePickling(object):
|
||||||
|
|
||||||
version = 1
|
version = 2
|
||||||
"""
|
"""
|
||||||
Version number (integer) for file system cache.
|
Version number (integer) for file system cache.
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ any actual importing done. This module is about finding modules in the
|
|||||||
filesystem. This can be quite tricky sometimes, because Python imports are not
|
filesystem. This can be quite tricky sometimes, because Python imports are not
|
||||||
always that simple.
|
always that simple.
|
||||||
|
|
||||||
Currently the import process uses ``imp`` to find modules. In the future, it's
|
This module uses imp for python up to 3.2 and importlib for python 3.3 on; the
|
||||||
a goal to use ``importlib`` for this purpose. There's a `pull request
|
correct implementation is delegated to _compatibility.
|
||||||
<https://github.com/davidhalter/jedi/pull/109>`_ for that.
|
|
||||||
|
|
||||||
This module also supports import autocompletion, which means to complete
|
This module also supports import autocompletion, which means to complete
|
||||||
statements like ``from datetim`` (curser at the end would return ``datetime``).
|
statements like ``from datetim`` (curser at the end would return ``datetime``).
|
||||||
@@ -17,7 +16,6 @@ from __future__ import with_statement
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import pkgutil
|
import pkgutil
|
||||||
import imp
|
|
||||||
import sys
|
import sys
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
|
|||||||
@@ -560,8 +560,10 @@ class Flow(Scope):
|
|||||||
@parent.setter
|
@parent.setter
|
||||||
def parent(self, value):
|
def parent(self, value):
|
||||||
self._parent = value
|
self._parent = value
|
||||||
if hasattr(self, "next") and self.next:
|
try:
|
||||||
self.next.parent = value
|
self.next.parent = value
|
||||||
|
except AttributeError:
|
||||||
|
return
|
||||||
|
|
||||||
def get_code(self, first_indent=False, indention=' '):
|
def get_code(self, first_indent=False, indention=' '):
|
||||||
stmts = []
|
stmts = []
|
||||||
|
|||||||
Reference in New Issue
Block a user