1
0
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:
Aldo Stracquadanio
2013-03-24 10:14:14 +00:00
parent 3ef564847d
commit 07ec134bc9
6 changed files with 15 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ env:
- TOXENV=py26
- TOXENV=py27
- TOXENV=py32
- TOXENV=py33
install:
- pip install --quiet --use-mirrors tox
script:

View File

@@ -9,7 +9,6 @@ will be dropped, we'll get rid of most code.
import sys
import imp
import os
import io
try:
import importlib
except:
@@ -31,11 +30,14 @@ def find_module_py33(string, path=None):
raise ImportError
try:
filename = importing.get_filename(string)
if filename and os.path.exists(filename):
returning = (open(filename, 'U'), filename, False)
if (importing.is_package(string)):
returning = (None, os.path.dirname(importing.path), True)
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:
returning = (None, importing.load_module(string).__name__, False)

View File

@@ -222,7 +222,7 @@ def save_module(path, name, parser, pickling=True):
class _ModulePickling(object):
version = 1
version = 2
"""
Version number (integer) for file system cache.

View File

@@ -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
always that simple.
Currently the import process uses ``imp`` to find modules. In the future, it's
a goal to use ``importlib`` for this purpose. There's a `pull request
<https://github.com/davidhalter/jedi/pull/109>`_ for that.
This module uses imp for python up to 3.2 and importlib for python 3.3 on; the
correct implementation is delegated to _compatibility.
This module also supports import autocompletion, which means to complete
statements like ``from datetim`` (curser at the end would return ``datetime``).
@@ -17,7 +16,6 @@ from __future__ import with_statement
import os
import pkgutil
import imp
import sys
import itertools

View File

@@ -560,8 +560,10 @@ class Flow(Scope):
@parent.setter
def parent(self, value):
self._parent = value
if hasattr(self, "next") and self.next:
try:
self.next.parent = value
except AttributeError:
return
def get_code(self, first_indent=False, indention=' '):
stmts = []

View File

@@ -1,5 +1,5 @@
[tox]
envlist = py25, py26, py27, py32
envlist = py25, py26, py27, py32, py33
[testenv]
deps =
pytest