forked from VimPlug/jedi
Use isinstance instead of unary type
This commit is contained in:
@@ -321,7 +321,7 @@ def _generate_code(scope, mixin_funcs={}, depth=0):
|
||||
file_type = io.TextIOWrapper
|
||||
else:
|
||||
file_type = types.FileType
|
||||
if type(value) == file_type:
|
||||
if isinstance(value, file_type):
|
||||
value = 'open()'
|
||||
elif name == 'None':
|
||||
value = ''
|
||||
|
||||
@@ -526,7 +526,7 @@ def check_statement_information(stmt, search_name):
|
||||
# this might be removed if we analyze and, etc
|
||||
assert len(commands) == 1
|
||||
call = commands[0]
|
||||
assert type(call) == pr.Call and str(call.name) == 'isinstance'
|
||||
assert isinstance(call, pr.Call) and str(call.name) == 'isinstance'
|
||||
assert bool(call.execution)
|
||||
|
||||
# isinstance check
|
||||
|
||||
@@ -643,7 +643,7 @@ class Execution(Executable):
|
||||
call = key_stmt.get_commands()[0]
|
||||
if isinstance(call, pr.Name):
|
||||
yield call, value_stmt
|
||||
elif type(call) == pr.Call:
|
||||
elif isinstance(call, pr.Call):
|
||||
yield call.name, value_stmt
|
||||
# Normal arguments (including key arguments).
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user