Skip to content

Add IOBase to types fcntl will accept as files #1556

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

Merged
merged 3 commits into from
Aug 29, 2017

Conversation

OddBloke
Copy link
Contributor

Anything that implements a fileno() method is acceptable (per https://github.com/python/cpython/blob/master/Objects/fileobject.c#L168-L173), and IOBase fits the bill.

Fixes #1548.

@@ -1,6 +1,6 @@
# Stubs for fcntl
from io import IOBase as _IOBase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the as _IOBase here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@JelleZijlstra
Copy link
Member

This feels a bit too ad hoc, but I suppose it's the best we can do until we have protocols. Can you fix the small style comment I added?

@JelleZijlstra JelleZijlstra merged commit 258b9fb into python:master Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants