Kaydet (Commit) 40b0f3aa authored tarafından Guido van Rossum's avatar Guido van Rossum

Use built-in file.read() instead of util.readfile().

üst 001fa6a2
......@@ -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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment