mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
sys.std{in,out,err} implemented in the most simple way
- It respects what already exists if any - Otherwise it opens de UNIX standard files Caveats: - May be not on the proper place - Is open to discussion on what codec, or if should be opened as bytes - Can be also done in Rust side
This commit is contained in:
1 parent
336364c80d
commit
084cd0ae3d
1 file changed
+5
Vendored
+5
@@ -10,6 +10,11 @@ The objects used by the site module to add custom builtins.
|
||||
|
||||
import sys
|
||||
|
||||
sys.stdin = getattr(sys, 'stdin', False) or open('/dev/stdin')
|
||||
sys.stdout = getattr(sys, 'stdout', False) or open('/dev/stdout', 'w')
|
||||
sys.stderr = getattr(sys, 'stderr', False) or open('/dev/stderr', 'w')
|
||||
|
||||
|
||||
class Quitter(object):
|
||||
def __init__(self, name, eof):
|
||||
self.name = name
|
||||
|
||||
Reference in new issue
Block a user