Utilities/compatibility_fixes.py

branch
6_0_x
changeset 4185
07030b761baf
parent 3670
f0cb7579c0b4
child 4289
6c1ab651c9ce
equal deleted inserted replaced
4181:f9e3b6472b44 4185:07030b761baf
7 Module implementing the open behavior of Python3 for use with Eric6. 7 Module implementing the open behavior of Python3 for use with Eric6.
8 8
9 The Eric6 used features are emulated only. The not emulated features 9 The Eric6 used features are emulated only. The not emulated features
10 should throw a NotImplementedError exception. 10 should throw a NotImplementedError exception.
11 """ 11 """
12
13 from __future__ import unicode_literals
14 12
15 import __builtin__ 13 import __builtin__
16 import codecs 14 import codecs
17 15
18 16
56 @keyparam closefd close underlying file descriptor if given as file 54 @keyparam closefd close underlying file descriptor if given as file
57 parameter (boolean) 55 parameter (boolean)
58 @exception NotImplementedError for not implemented method parameters 56 @exception NotImplementedError for not implemented method parameters
59 """ 57 """
60 self.__encoding = encoding 58 self.__encoding = encoding
61 self.__newline = newline 59 self.__newline = str(newline)
62 self.__closefd = closefd 60 self.__closefd = closefd
63 if newline is not None: 61 if newline is not None:
64 if 'r' in mode: 62 if 'r' in mode:
65 raise NotImplementedError 63 raise NotImplementedError
66 else: 64 else:

eric ide

mercurial