]> granicus.if.org Git - python/commitdiff
Minimal fixes to save the bootstrap on OSX.
authorGuido van Rossum <guido@python.org>
Fri, 25 May 2007 18:39:29 +0000 (18:39 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 25 May 2007 18:39:29 +0000 (18:39 +0000)
Lib/distutils/sysconfig.py
Lib/distutils/text_file.py

index ea2e0597788ec9c2940f15f2b449dec2cdd59dc2..51f23a24a554d71ad0c613a6f9b91e848d6a2586 100644 (file)
@@ -11,6 +11,7 @@ Email:        <fdrake@acm.org>
 
 __revision__ = "$Id$"
 
+import io
 import os
 import re
 import sys
@@ -353,7 +354,7 @@ def _init_posix():
     # 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"):
index c23a31dd9cd04ac987646b1346bfd89781767b6b..9d4d42b4c6443b02b2d6bc0d8bcb75a7e76293aa 100644 (file)
@@ -7,7 +7,7 @@ lines, and joining lines with backslashes."""
 __revision__ = "$Id$"
 
 from types import *
-import sys, os
+import sys, os, io
 
 
 class TextFile:
@@ -34,7 +34,7 @@ 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()':
@@ -118,7 +118,7 @@ class TextFile:
            '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