Commit 3781b2e4 authored by Tres Seaver's avatar Tres Seaver

Merge pull request #33 from gocept/icemac-WindowsError-default

Don't bail on WindowsError which is not existing on non-windows systems.
parents e2888694 15e6600a
...@@ -26,6 +26,12 @@ from ZConfig.components.logger import loghandler ...@@ -26,6 +26,12 @@ from ZConfig.components.logger import loghandler
from zope.event import notify from zope.event import notify
from zope.processlifetime import ProcessStarting from zope.processlifetime import ProcessStarting
try:
IO_ERRORS = (IOError, WindowsError)
except NameError:
IO_ERRORS = (IOError,)
logger = logging.getLogger("Zope") logger = logging.getLogger("Zope")
started = False started = False
...@@ -280,7 +286,7 @@ class ZopeStarter: ...@@ -280,7 +286,7 @@ class ZopeStarter:
lock_file(self.lockfile) lock_file(self.lockfile)
self.lockfile.write(str(os.getpid())) self.lockfile.write(str(os.getpid()))
self.lockfile.flush() self.lockfile.flush()
except (IOError, WindowsError): except IO_ERRORS:
pass pass
def makePidFile(self): def makePidFile(self):
...@@ -292,7 +298,7 @@ class ZopeStarter: ...@@ -292,7 +298,7 @@ class ZopeStarter:
f = open(self.cfg.pid_filename, 'w') f = open(self.cfg.pid_filename, 'w')
f.write(str(os.getpid())) f.write(str(os.getpid()))
f.close() f.close()
except (IOError, WindowsError): except IO_ERRORS:
pass pass
def unlinkPidFile(self): def unlinkPidFile(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment