[Zodb-checkins] CVS: ZODB3/ZEO - runsvr.py:1.6

Guido van Rossum guido@python.org
Tue, 19 Nov 2002 15:32:17 -0500


Update of /cvs-repository/ZODB3/ZEO
In directory cvs.zope.org:/tmp/cvs-serv1191

Modified Files:
	runsvr.py 
Log Message:
Move close_storages() call to finally: clause in main().

Rephrase error message about address in use.


=== ZODB3/ZEO/runsvr.py 1.5 => 1.6 ===
--- ZODB3/ZEO/runsvr.py:1.5	Tue Nov 19 14:38:29 2002
+++ ZODB3/ZEO/runsvr.py	Tue Nov 19 15:32:16 2002
@@ -202,12 +202,13 @@
     def main(self):
         self.check_socket()
         self.clear_socket()
-        self.open_storages()
-        self.setup_signals()
         try:
+            self.open_storages()
+            self.setup_signals()
             self.create_server()
             self.loop_forever()
         finally:
+            self.close_storages()
             self.clear_socket()
 
     def check_socket(self):
@@ -221,7 +222,7 @@
             pass
         else:
             s.close()
-            self.opts.usage("address %r still in use" % self.opts.address)
+            self.opts.usage("address %r already in use" % self.opts.address)
 
     def clear_socket(self):
         if isinstance(self.opts.address, type("")):
@@ -293,12 +294,10 @@
 
     def handle_sigterm(self):
         info("terminated by SIGTERM")
-        self.close_storages()
         sys.exit(0)
 
     def handle_sigint(self):
         info("terminated by SIGINT")
-        self.close_storages()
         sys.exit(0)
 
     def handle_sigusr2(self):