summaryrefslogtreecommitdiff
path: root/GstDebugViewer
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2011-11-16 19:50:06 +0100
committerRené Stadler <mail@renestadler.de>2011-11-16 19:54:17 +0100
commit4ffc2e9f149774ca862cc25981629ce52209f00f (patch)
tree6ce64485615060c1d1b7d9cf0cf97ff63f95dabd /GstDebugViewer
parent31b3e6a33e9172c8dfb1371546b7a4befba4093b (diff)
GUI: use 'with' statement
Diffstat (limited to 'GstDebugViewer')
-rw-r--r--GstDebugViewer/Common/GUI.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/GstDebugViewer/Common/GUI.py b/GstDebugViewer/Common/GUI.py
index 51ad434..1b25851 100644
--- a/GstDebugViewer/Common/GUI.py
+++ b/GstDebugViewer/Common/GUI.py
@@ -454,14 +454,8 @@ class State (object):
def save (self):
- # TODO Py2.5: Use 'with' statement.
- fp = utils.SaveWriteFile (self._filename, "wt")
- try:
+ with utils.SaveWriteFile (self._filename, "wt") as fp:
self._parser.write (fp)
- except:
- fp.discard ()
- else:
- fp.close ()
class WindowState (object):