remus: write circumlocution for try..except..finally

Parsing /otc/source/vtd/xen-unstable/tools/python/../../tools/libxl/libxl.idl
  File "/usr/lib64/python2.4/site-packages/xen/remus/save.py", line 169
    finally:
          ^
SyntaxError: invalid syntax

This was introduced in 23195:13ec53a59a42
It is a problem for Python 2.4 and earlier, only.

So use try...(try...except)...finally as suggested by Ian Campbell.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Acked-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Jinsong Liu committed 2011-05-24 16:12:25 +01:00
1 parent 3b6eaa3e34
commit 2cb4424e3a
1 file changed
+6 -5
+6 -5
View File
@@ -161,11 +161,12 @@ class Saver(object):
self.checkpointer = xen.lowlevel.checkpoint.checkpointer()
try:
self.checkpointer.open(self.vm.domid)
self.checkpointer.start(self.fd, self.suspendcb, self.resumecb,
self.checkpointcb, self.interval)
except xen.lowlevel.checkpoint.error, e:
raise CheckpointError(e)
try:
self.checkpointer.open(self.vm.domid)
self.checkpointer.start(self.fd, self.suspendcb, self.resumecb,
self.checkpointcb, self.interval)
except xen.lowlevel.checkpoint.error, e:
raise CheckpointError(e)
finally:
try: #errors in checkpoint close are not critical atm.
self.checkpointer.close()
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.