Commit 846a6d17 authored by Guido van Rossum's avatar Guido van Rossum

Minimal fixes to save the bootstrap on OSX.

parent 0a68cc8e
...@@ -11,6 +11,7 @@ Email: <fdrake@acm.org> ...@@ -11,6 +11,7 @@ Email: <fdrake@acm.org>
__revision__ = "$Id$" __revision__ = "$Id$"
import io
import os import os
import re import re
import sys import sys
...@@ -353,7 +354,7 @@ def _init_posix(): ...@@ -353,7 +354,7 @@ def _init_posix():
# load the installed pyconfig.h: # load the installed pyconfig.h:
try: try:
filename = get_config_h_filename() filename = get_config_h_filename()
parse_config_h(open(filename), g) parse_config_h(io.open(filename), g)
except IOError as msg: except IOError as msg:
my_msg = "invalid Python installation: unable to open %s" % filename my_msg = "invalid Python installation: unable to open %s" % filename
if hasattr(msg, "strerror"): if hasattr(msg, "strerror"):
......
...@@ -7,7 +7,7 @@ lines, and joining lines with backslashes.""" ...@@ -7,7 +7,7 @@ lines, and joining lines with backslashes."""
__revision__ = "$Id$" __revision__ = "$Id$"
from types import * from types import *
import sys, os import sys, os, io
class TextFile: class TextFile:
...@@ -34,7 +34,7 @@ class TextFile: ...@@ -34,7 +34,7 @@ class TextFile:
something that provides 'readline()' and 'close()' methods). It is something that provides 'readline()' and 'close()' methods). It is
recommended that you supply at least 'filename', so that TextFile recommended that you supply at least 'filename', so that TextFile
can include it in warning messages. If 'file' is not supplied, 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 The options are all boolean, and affect the value returned by
'readline()': 'readline()':
...@@ -118,7 +118,7 @@ class TextFile: ...@@ -118,7 +118,7 @@ class TextFile:
'filename' and 'file' arguments to the constructor.""" 'filename' and 'file' arguments to the constructor."""
self.filename = filename self.filename = filename
self.file = open (self.filename, 'r') self.file = io.open (self.filename, 'r')
self.current_line = 0 self.current_line = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment