changing completion of python file objects

This commit is contained in:
Dave Halter
2014-01-12 18:07:58 +01:00
parent 99fe204496
commit 2bde6cde08
5 changed files with 36 additions and 23 deletions

View File

@@ -1,3 +1,3 @@
class TextIOWrapper():
def __next__(self):
return ''
return 'hacked io return'

View File

@@ -45,6 +45,15 @@ class xrange():
return 1
def open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True):
import io
return io.TextIOWrapper(file, mode, buffering, encoding, errors, newline, closefd)
def open_python2(name, mode=None, buffering=None):
return file(name, mode, buffering)
#--------------------------------------------------------
# descriptors
#--------------------------------------------------------