[pypy-commit] pypy default: test/fix stdin/stdout/stderr file name
bdkearns
noreply at buildbot.pypy.org
Thu Sep 11 01:26:26 CEST 2014
Author: Brian Kearns <bdkearns at gmail.com>
Branch:
Changeset: r73427:f9915af38176
Date: 2014-09-10 19:08 -0400
http://bitbucket.org/pypy/pypy/changeset/f9915af38176/
Log: test/fix stdin/stdout/stderr file name
diff --git a/pypy/module/sys/state.py b/pypy/module/sys/state.py
--- a/pypy/module/sys/state.py
+++ b/pypy/module/sys/state.py
@@ -36,17 +36,17 @@
stdin = W_File(space)
stdin.file_fdopen(0, "r", 1)
- stdin.name = '<stdin>'
+ stdin.w_name = space.wrap('<stdin>')
self.w_stdin = space.wrap(stdin)
stdout = W_File(space)
stdout.file_fdopen(1, "w", 1)
- stdout.name = '<stdout>'
+ stdout.w_name = space.wrap('<stdout>')
self.w_stdout = space.wrap(stdout)
stderr = W_File(space)
stderr.file_fdopen(2, "w", 0)
- stderr.name = '<stderr>'
+ stderr.w_name = space.wrap('<stderr>')
self.w_stderr = space.wrap(stderr)
stdin._when_reading_first_flush(stdout)
diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py
--- a/pypy/module/sys/test/test_sysmodule.py
+++ b/pypy/module/sys/test/test_sysmodule.py
@@ -91,6 +91,10 @@
assert isinstance(sys.__stderr__, file)
assert isinstance(sys.__stdin__, file)
+ assert sys.__stdin__.name == "<stdin>"
+ assert sys.__stdout__.name == "<stdout>"
+ assert sys.__stderr__.name == "<stderr>"
+
if self.appdirect and not isinstance(sys.stdin, file):
return
More information about the pypy-commit
mailing list