-
Notifications
You must be signed in to change notification settings - Fork 272
maintaining original sys.stdin #59
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What bug does this fix, just to be clear?
@@ -35,18 +35,21 @@ class Reader: | |||
https://bugs.python.org/issue24402 | |||
""" | |||
|
|||
def __init__(self, f): | |||
self.f = f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's f
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can/should we rename? Feels a bit magical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was trying to be consistent with what you have here
Line 21 in d03d296
self.f = f |
file
) passed to the constructor here. We're instantiating a few lines later and passing it sys.stdin
, so in the instance that we're using self.f
is original sys.stdin
.
Which happens when using IDLE on Windows at least. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prior to this change, get_string
was hanging on both macOS and Linux when used under IDLE. This fix resolves that problem. With it, get_string
seems to work fine under IDLE on both platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, gotcha, nice fix. Thanks!
No description provided.