mirror of https://github.com/python/cpython.git
default mode="r" and add optional bufsize
This commit is contained in:
parent
27e177d005
commit
13c503e93b
|
@ -76,9 +76,9 @@ def __del__(self):
|
||||||
#
|
#
|
||||||
# Initialization routines
|
# Initialization routines
|
||||||
#
|
#
|
||||||
def open(self, name, mode):
|
def open(self, name, mode='r', bufsize=-1):
|
||||||
import __builtin__
|
import __builtin__
|
||||||
return self.fileopen(__builtin__.open(name, mode))
|
return self.fileopen(__builtin__.open(name, mode, bufsize))
|
||||||
|
|
||||||
def fileopen(self, file):
|
def fileopen(self, file):
|
||||||
if `type(file)` != "<type 'file'>":
|
if `type(file)` != "<type 'file'>":
|
||||||
|
|
Loading…
Reference in New Issue