diff options
author | Richard Vézina <ml.richard.vezina@gmail.com> | 2021-10-15 21:41:25 -0400 |
---|---|---|
committer | Richard Vézina <ml.richard.vezina@gmail.com> | 2021-10-15 21:41:25 -0400 |
commit | 561e5b19134799a6f2bc19e8a20ac85d6eb95067 (patch) | |
tree | 1b4f39303602068f353edf6a94864da42d907055 | |
parent | 14a0293224e78875e74bfc6491017d6059aa07f5 (diff) | |
download | tftpy-561e5b19134799a6f2bc19e8a20ac85d6eb95067.tar.gz |
Enhance PEP8
-rw-r--r-- | tftpy/compat.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tftpy/compat.py b/tftpy/compat.py index 0049396..d889f74 100644 --- a/tftpy/compat.py +++ b/tftpy/compat.py @@ -1,12 +1,13 @@ import sys + def binary_stdin(): """ Get a file object for reading binary bytes from stdin instead of text. Compatible with Py2/3, POSIX & win32. Credits: https://stackoverflow.com/a/38939320/531179 (CC BY-SA 3.0) """ - if hasattr(sys.stdin, 'buffer'): # Py3+ + if hasattr(sys.stdin, 'buffer'): # Py3+ return sys.stdin.buffer else: if sys.platform == 'win32': |