Update of /cvs-repository/Packages/ZEO
In directory cvs.zope.org:/tmp/cvs-serv32710

Modified Files:
      Tag: Zope-2_7-branch
        runzeo.py 
Log Message:
Saner code for dealing with the possible absence of os.getpid().


=== Packages/ZEO/runzeo.py 1.15.6.8 => 1.15.6.9 ===
--- Packages/ZEO/runzeo.py:1.15.6.8     Mon Apr 18 14:47:08 2005
+++ Packages/ZEO/runzeo.py      Mon Apr 18 15:02:28 2005
@@ -291,18 +291,20 @@
             pidfile = self.options.pid_file
             if pidfile is None:
                 return
+            if hasattr(os, "getpid"):
+                pid = os.getpid()
+            else:
+                info("cannot create pid file -- os.getpid() not supported")
+                return
             try:
                 if os.path.exists(pidfile):
                     os.unlink(pidfile)
-                pid = os.getpid()
                 f = open(pidfile, 'w')
                 print >> f, pid
                 f.close()
                 info("created PID file '%s'" % pidfile)
             except IOError:
                 error("PID file '%s' cannot be opened" % pidfile)
-            except AttributeError:
-                pass  # getpid not supported. Unix/Win only
 
     def remove_pidfile(self):
         if not self.options.read_only:

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to