Skip to content
Commit 5869385c authored by Louis MARTIN's avatar Louis MARTIN Committed by Facebook Github Bot
Browse files

Try to access sys.stdin.fileno() only at runtime and not during import (#553)

Summary:
Accessing sys.stdin.fileno() raises an error in multiple contexts
(pytest, joblib, jupyter...).
Thus accessing it at the top level of the file can cause other scripts
to crash when they import fairseq.
This is why it is moved inside the method of MultiprocessingPdb to only
be accessed at runtime if needed.

See  Issue #517
Pull Request resolved: https://github.com/pytorch/fairseq/pull/553

Differential Revision: D14309284

Pulled By: myleott

fbshipit-source-id: 6ca36f2053a86ebc02e2d6f025459c6a78c592e7
parent 2ad1178e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment