Patch 1267 by Christian Heimes.

Move the initialization of sys.std{in,out,err} and __builtin__.open
to C code.
This solves the problem that "python -S" wouldn't work.
This commit is contained in:
Guido van Rossum 2007-10-19 23:16:50 +00:00
parent 75a902db78
commit ce3a72aec6
11 changed files with 175 additions and 31 deletions

View file

@ -38,9 +38,16 @@ class LockTests(unittest.TestCase):
self.fail("release_lock() without lock should raise "
"RuntimeError")
class ImportTests(unittest.TestCase):
def test_find_module_encoding(self):
fd = imp.find_module("heapq")[0]
self.assertEqual(fd.encoding, "iso-8859-1")
def test_main():
test_support.run_unittest(
LockTests,
ImportTests,
)
if __name__ == "__main__":