forked from Imagelibrary/littlefs
scripts: Fixed openio issue where some scripts didn't import os
This only failed if "-" was used as an argument (for stdin/stdout), so the issue was pretty hard to spot. openio is a heavily copy-pasted function, so it makes sense to just add the import os to openio directly. Otherwise this mistake will likely happen again in the future.
This commit is contained in:
@@ -134,6 +134,7 @@ def si2(x, w=5):
|
||||
|
||||
def openio(path, mode='r', buffering=-1):
|
||||
# allow '-' for stdin/stdout
|
||||
import os
|
||||
if path == '-':
|
||||
if 'r' in mode:
|
||||
return os.fdopen(os.dup(sys.stdin.fileno()), mode, buffering)
|
||||
|
||||
Reference in New Issue
Block a user