I like this patch. https://codereview.appspot.com/183310044/diff/1/asyncio/unix_events.py File asyncio/unix_events.py (right): https://codereview.appspot.com/183310044/diff/1/asyncio/unix_events.py#newcod... asyncio/unix_events.py:556: def _set_inheritable(fd, inheritable): I'd simply put "import fcntl" above this line.