From 40b0f3aa0e814ede1cce8447c53f475f667cb792 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sun, 21 Apr 1991 19:31:39 +0000 Subject: Use built-in file.read() instead of util.readfile(). --- Lib/lib-stdwin/filewin.py | 8 +++++--- Lib/stdwin/filewin.py | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Lib/lib-stdwin/filewin.py b/Lib/lib-stdwin/filewin.py index 6a224e7..a03c3f7 100644 --- a/Lib/lib-stdwin/filewin.py +++ b/Lib/lib-stdwin/filewin.py @@ -2,17 +2,19 @@ # File windows, a subclass of textwin (which is a subclass of gwin) import textwin -from util import readfile +import builtin # FILE WINDOW def open_readonly(fn): # Open a file window - w = textwin.open_readonly(fn, readfile(fn)) + fp = builtin.open(fn, 'r') + w = textwin.open_readonly(fn, fp.read()) w.fn = fn return w def open(fn): # Open a file window - w = textwin.open(fn, readfile(fn)) + fp = builtin.open(fn, 'r') + w = textwin.open(fn, fp.read()) w.fn = fn return w diff --git a/Lib/stdwin/filewin.py b/Lib/stdwin/filewin.py index 6a224e7..a03c3f7 100755 --- a/Lib/stdwin/filewin.py +++ b/Lib/stdwin/filewin.py @@ -2,17 +2,19 @@ # File windows, a subclass of textwin (which is a subclass of gwin) import textwin -from util import readfile +import builtin # FILE WINDOW def open_readonly(fn): # Open a file window - w = textwin.open_readonly(fn, readfile(fn)) + fp = builtin.open(fn, 'r') + w = textwin.open_readonly(fn, fp.read()) w.fn = fn return w def open(fn): # Open a file window - w = textwin.open(fn, readfile(fn)) + fp = builtin.open(fn, 'r') + w = textwin.open(fn, fp.read()) w.fn = fn return w -- cgit v0.12