[Python-checkins] r74421 - python/branches/tk_and_idle_maintenance/Lib/idlelib/ScriptBinding.py

guilherme.polo python-checkins at python.org
Thu Aug 13 18:56:34 CEST 2009


Author: guilherme.polo
Date: Thu Aug 13 18:56:34 2009
New Revision: 74421
Log:
Be a bit safer when removing a temp file.
Modified:
 python/branches/tk_and_idle_maintenance/Lib/idlelib/ScriptBinding.py
Modified: python/branches/tk_and_idle_maintenance/Lib/idlelib/ScriptBinding.py
==============================================================================
--- python/branches/tk_and_idle_maintenance/Lib/idlelib/ScriptBinding.py	(original)
+++ python/branches/tk_and_idle_maintenance/Lib/idlelib/ScriptBinding.py	Thu Aug 13 18:56:34 2009
@@ -55,7 +55,10 @@
 
 def _cleanup_temp(self, filename, is_temp=True):
 if is_temp:
- os.unlink(filename)
+ try:
+ os.unlink(filename)
+ except OSError:
+ pass
 
 def check_module_event(self, event):
 filename, is_temp = self.getfilename()


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /