__revision__ = "$Id$"
+import io
import os
import re
import sys
# load the installed pyconfig.h:
try:
filename = get_config_h_filename()
- parse_config_h(open(filename), g)
+ parse_config_h(io.open(filename), g)
except IOError as msg:
my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"):
__revision__ = "$Id$"
from types import *
-import sys, os
+import sys, os, io
class TextFile:
something that provides 'readline()' and 'close()' methods). It is
recommended that you supply at least 'filename', so that TextFile
can include it in warning messages. If 'file' is not supplied,
- TextFile creates its own using the 'open()' builtin.
+ TextFile creates its own using 'io.open()'.
The options are all boolean, and affect the value returned by
'readline()':
'filename' and 'file' arguments to the constructor."""
self.filename = filename
- self.file = open (self.filename, 'r')
+ self.file = io.open (self.filename, 'r')
self.current_line = 0