Utilities/compatibility_fixes.py

branch
Py2 comp.
changeset 3515
1b8381afe38f
parent 3145
a9de05d4a22f
child 3539
0c2dc1446ebf
equal deleted inserted replaced
3506:d85fadb263a0 3515:1b8381afe38f
33 @return Returns the new file object 33 @return Returns the new file object
34 """ 34 """
35 return File(file, mode, buffering, encoding, errors, newline, closefd) 35 return File(file, mode, buffering, encoding, errors, newline, closefd)
36 36
37 37
38 class File(file): #__IGNORE_WARNING__ 38 class File(file): # __IGNORE_WARNING__
39 """ 39 """
40 Facade for the original file class. 40 Facade for the original file class.
41 """ 41 """
42 def __init__(self, filein, mode='r', buffering=-1, 42 def __init__(self, filein, mode='r', buffering=-1,
43 encoding=None, errors=None, newline=None, closefd=True): 43 encoding=None, errors=None, newline=None, closefd=True):
72 if errors is None: 72 if errors is None:
73 self.__errors = 'strict' 73 self.__errors = 'strict'
74 else: 74 else:
75 self.__errors = errors 75 self.__errors = errors
76 76
77 file.__init__(self, filein, mode, buffering) #__IGNORE_WARNING__ 77 file.__init__(self, filein, mode, buffering) # __IGNORE_WARNING__
78 78
79 def read(self, n=-1): 79 def read(self, n=-1):
80 """ 80 """
81 Read n bytes or all if n=-1 from file. 81 Read n bytes or all if n=-1 from file.
82 82

eric ide

mercurial