Browse files

changed with to try/finally for py 2.4

  • Loading branch information...
1 parent 3b14bf9 commit 55de9689630fa2322e5eac58fac6c29f4abdff50 root committed Nov 16, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 zktop.py
View
5 zktop.py
@@ -329,8 +329,11 @@ def sigwinch_handler(*nada):
resized_sig = True
def read_zk_config(filename):
- with open(filename) as f:
+ f = open(filename, 'r')
+ try:
config = dict(tuple(line.rstrip().split('=', 1)) for line in f if line.rstrip())
+ finally:
+ f.close()
return config
def get_zk_servers(filename):

0 comments on commit 55de968

Please sign in to comment.