mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Fix flask issues with unicode in Python2
This commit is contained in:
@@ -13,16 +13,16 @@ class FlaskPlugin(BasePlugin):
|
|||||||
def wrapper(evaluator, import_names, module_context, sys_path):
|
def wrapper(evaluator, import_names, module_context, sys_path):
|
||||||
if len(import_names) == 3 and import_names[:2] == ('flask', 'ext'):
|
if len(import_names) == 3 and import_names[:2] == ('flask', 'ext'):
|
||||||
# New style.
|
# New style.
|
||||||
ipath = ('flask_' + import_names[2]),
|
ipath = (u'flask_' + import_names[2]),
|
||||||
try:
|
try:
|
||||||
return callback(evaluator, ipath, None, sys_path)
|
return callback(evaluator, ipath, None, sys_path)
|
||||||
except JediImportError:
|
except JediImportError:
|
||||||
context_set = callback(evaluator, ('flaskext',), None, sys_path)
|
context_set = callback(evaluator, (u'flaskext',), None, sys_path)
|
||||||
# If context_set has no content a JediImportError is raised
|
# If context_set has no content a JediImportError is raised
|
||||||
# which should be caught anyway by the caller.
|
# which should be caught anyway by the caller.
|
||||||
return callback(
|
return callback(
|
||||||
evaluator,
|
evaluator,
|
||||||
('flaskext', import_names[2]),
|
(u'flaskext', import_names[2]),
|
||||||
next(iter(context_set)),
|
next(iter(context_set)),
|
||||||
sys_path
|
sys_path
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user