# HG changeset patch # User Paul Boddie # Date 1481052950 -3600 # Node ID 575115c7ce7391311e56e2f9589ce0c81fbaa361 # Parent d6bd77febdbaa7259b11612089af3da76e8d0053 Moved sysfile into the posix.io module. diff -r d6bd77febdba -r 575115c7ce73 lib/__builtins__/__init__.py --- a/lib/__builtins__/__init__.py Tue Dec 06 20:32:33 2016 +0100 +++ b/lib/__builtins__/__init__.py Tue Dec 06 20:35:50 2016 +0100 @@ -90,7 +90,7 @@ from __builtins__.character import chr, hex, oct, ord, unichr from __builtins__.comparable import cmp, hash from __builtins__.identity import callable, help, id, isinstance, issubclass, repr -from __builtins__.io import open, raw_input, print_, sysfile +from __builtins__.io import open, raw_input, print_ from __builtins__.iterable import all, any, enumerate, filter, iter, len, map, max, min, reduce, reversed, sorted, sum, zip from __builtins__.namespace import dir, globals, locals, vars from __builtins__.numeric import abs, divmod, pow, round diff -r d6bd77febdba -r 575115c7ce73 lib/__builtins__/io.py --- a/lib/__builtins__/io.py Tue Dec 06 20:32:33 2016 +0100 +++ b/lib/__builtins__/io.py Tue Dec 06 20:35:50 2016 +0100 @@ -19,30 +19,6 @@ this program. If not, see . """ -from posix.io import fdopen, read, write - -class sysfile: - - "A system-level file object." - - def __init__(self, fd): - - "Initialise the file with the given 'fd'." - - self.fd = fd - - def read(self, n): - - "Read 'n' bytes from the file." - - return read(self.fd, n) - - def write(self, s): - - "Write 's' to the file." - - write(self.fd, str(s)) - def open(name, mode=None, buffering=None): """ diff -r d6bd77febdba -r 575115c7ce73 lib/posix/io.py --- a/lib/posix/io.py Tue Dec 06 20:32:33 2016 +0100 +++ b/lib/posix/io.py Tue Dec 06 20:35:50 2016 +0100 @@ -21,6 +21,28 @@ import native +class sysfile: + + "A system-level file object." + + def __init__(self, fd): + + "Initialise the file with the given 'fd'." + + self.fd = fd + + def read(self, n): + + "Read 'n' bytes from the file." + + return read(self.fd, n) + + def write(self, s): + + "Write 's' to the file." + + write(self.fd, str(s)) + def close(fd): pass def closerange(fd_low, fd_high): pass def dup(fd): pass diff -r d6bd77febdba -r 575115c7ce73 lib/sys.py --- a/lib/sys.py Tue Dec 06 20:32:33 2016 +0100 +++ b/lib/sys.py Tue Dec 06 20:35:50 2016 +0100 @@ -20,6 +20,7 @@ """ from __builtins__.int import maxint, minint +from posix.io import sysfile import native # Standard streams.