1
0
forked from VimPlug/jedi

Remove most version_info.major usages

This commit is contained in:
Dave Halter
2020-07-02 03:00:01 +02:00
parent 188fdcd34f
commit 6e184bca97
16 changed files with 26 additions and 95 deletions

View File

@@ -182,14 +182,9 @@ def argument_clinic(clinic_string, want_value=False, want_context=False,
@argument_clinic('iterator[, default], /', want_inference_state=True)
def builtins_next(iterators, defaults, inference_state):
if inference_state.environment.version_info.major == 2:
name = 'next'
else:
name = '__next__'
# TODO theoretically we have to check here if something is an iterator.
# That is probably done by checking if it's not a class.
return defaults | iterators.py__getattribute__(name).execute_with_values()
return defaults | iterators.py__getattribute__('__next__').execute_with_values()
@argument_clinic('iterator[, default], /')