Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] qa: flake8 fixes for pyrepl/readline.py #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions pyrepl/readline.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_completions(self, stem):
while True:
try:
next = function(stem, state)
except:
except StopIteration:
break
if not isinstance(next, str):
break
Expand Down Expand Up @@ -424,13 +424,13 @@ def stub(*args, **kwds):
stub.func_name = _name
globals()[_name] = stub

for _name, _ret in [
('read_init_file', None),
('redisplay', None),
('set_pre_input_hook', None),
]:
assert _name not in globals(), _name
_make_stub(_name, _ret)

assert 'read_init_file' not in globals()
read_init_file = _make_stub('read_init_file', None)
assert 'redisplay' not in globals()
redisplay = _make_stub('redisplay', None)
assert 'set_pre_input_hook' not in globals()
set_pre_input_hook = _make_stub('set_pre_input_hook', None)


def _setup():
Expand Down Expand Up @@ -463,7 +463,7 @@ def _old_raw_input(prompt=''):
del sys.__raw_input__
except AttributeError:
pass
return raw_input(prompt)
return raw_input(prompt) # noqa: F821
sys.__raw_input__ = _wrapper.raw_input

else:
Expand All @@ -477,5 +477,6 @@ def _old_raw_input(prompt=''):
_old_raw_input = builtins.input
builtins.input = _wrapper.raw_input


_old_raw_input = None
_setup()