1
0
forked from VimPlug/jedi

Merge branch 'dev' of https://github.com/bstaint/jedi into dev

This commit is contained in:
Dave Halter
2016-08-01 15:17:52 +02:00
3 changed files with 16 additions and 1 deletions
+1
View File
@@ -39,6 +39,7 @@ Reinoud Elhorst (@reinhrst)
Guido van Rossum (@gvanrossum) <guido@python.org> Guido van Rossum (@gvanrossum) <guido@python.org>
Dmytro Sadovnychyi (@sadovnychyi) <jedi@dmit.ro> Dmytro Sadovnychyi (@sadovnychyi) <jedi@dmit.ro>
Cristi Burcă (@scribu) Cristi Burcă (@scribu)
bstaint (@bstaint)
Note: (@user) means a github user name. Note: (@user) means a github user name.
+7 -1
View File
@@ -340,7 +340,13 @@ def dotted_from_fs_path(fs_path, sys_path):
for s in sys_path: for s in sys_path:
if (fs_path.startswith(s) and len(path) < len(s)): if (fs_path.startswith(s) and len(path) < len(s)):
path = s path = s
return _path_re.sub('', fs_path[len(path):].lstrip(os.path.sep)).replace(os.path.sep, '.')
# - Window
# X:\path\to\lib-dynload/datetime.pyd => datetime
module_path = fs_path[len(path):].lstrip(os.path.sep).lstrip('/')
# - Window
# Replace like X:\path\to\something/foo/bar.py
return _path_re.sub('', module_path).replace(os.path.sep, '.').replace('/', '.')
def load_module(evaluator, path=None, name=None): def load_module(evaluator, path=None, name=None):
+8
View File
@@ -0,0 +1,8 @@
import jedi
def test_path_issues():
"""
See pull request #684 for details.
"""
source = '''from datetime import '''
assert jedi.Script(source).completions()