mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +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):
|
||||
if len(import_names) == 3 and import_names[:2] == ('flask', 'ext'):
|
||||
# New style.
|
||||
ipath = ('flask_' + import_names[2]),
|
||||
ipath = (u'flask_' + import_names[2]),
|
||||
try:
|
||||
return callback(evaluator, ipath, None, sys_path)
|
||||
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
|
||||
# which should be caught anyway by the caller.
|
||||
return callback(
|
||||
evaluator,
|
||||
('flaskext', import_names[2]),
|
||||
(u'flaskext', import_names[2]),
|
||||
next(iter(context_set)),
|
||||
sys_path
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user