summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2013-05-13 20:09:47 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2013-05-13 20:09:47 (GMT)
commit6599d0da7d53a9419b4a134d6f99591761fb73a4 (patch)
tree97fd0c789498829f352c7067578213eaf2b11ed3 /Lib/idlelib
parent9c60f66dc252079f01b6af9f7810a5e9758b0c66 (diff)
parentbf4cba7e8b2fd95351e28378c7716a62911d13e5 (diff)
downloadcpython-6599d0da7d53a9419b4a134d6f99591761fb73a4.zip
cpython-6599d0da7d53a9419b4a134d6f99591761fb73a4.tar.gz
cpython-6599d0da7d53a9419b4a134d6f99591761fb73a4.tar.bz2
Merge with 3.3
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/textView.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/idlelib/textView.py b/Lib/idlelib/textView.py
index 5bf7688..dd50544 100644
--- a/Lib/idlelib/textView.py
+++ b/Lib/idlelib/textView.py
@@ -80,7 +80,8 @@ if __name__ == '__main__':
root=Tk()
root.title('textView test')
filename = './textView.py'
- text = open(filename, 'r').read()
+ with open(filename, 'r') as f:
+ text = f.read()
btn1 = Button(root, text='view_text',
command=lambda:view_text(root, 'view_text', text))
btn1.pack(side=LEFT)