Commit 5459bd38 authored by Fred Drake's avatar Fred Drake

- remove unused import

- remove some old hacks now that we require Python 2.2
- reduce the scope of a try block to only wrap what needs to be
  checked
parent 546dde7d
...@@ -11,29 +11,15 @@ ...@@ -11,29 +11,15 @@
# #
############################################################################## ##############################################################################
import sys, os import sys
# HACKERY to get around asyncore issues. This ought to go away! We're
# currently using the Python 2.2 asyncore bundled with Zope to override
# brokenness in the Python 2.1 version. We need to do some funny business
# to make this work, as a 2.2-ism crept into the asyncore code.
if os.name == 'posix':
import fcntl
if not hasattr(fcntl, 'F_GETFL'):
import FCNTL
fcntl.F_GETFL = FCNTL.F_GETFL
fcntl.F_SETFL = FCNTL.F_SETFL
from medusa import asyncore from medusa import asyncore
sys.modules['asyncore'] = asyncore sys.modules['asyncore'] = asyncore
from medusa.test import max_sockets from medusa.test import max_sockets
CONNECTION_LIMIT=max_sockets.max_select_sockets() CONNECTION_LIMIT=max_sockets.max_select_sockets()
ZSERVER_VERSION='1.1b1' ZSERVER_VERSION='1.1b1'
import App.FindHomes
try: try:
import App.version_txt import App.version_txt
ZOPE_VERSION=App.version_txt.version_txt() ZOPE_VERSION=App.version_txt.version_txt()
...@@ -44,8 +30,12 @@ except: ...@@ -44,8 +30,12 @@ except:
# Try to poke zLOG default logging into asyncore # Try to poke zLOG default logging into asyncore
# XXX We should probably should do a better job of this, # XXX We should probably should do a better job of this,
# however that would mean that ZServer required zLOG. # however that would mean that ZServer required zLOG.
# (Is that really a bad thing?)
try: try:
from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
except ImportError:
pass
else:
register_subsystem('ZServer') register_subsystem('ZServer')
severity={'info':INFO, 'warning':WARNING, 'error': ERROR} severity={'info':INFO, 'warning':WARNING, 'error': ERROR}
...@@ -59,22 +49,18 @@ try: ...@@ -59,22 +49,18 @@ try:
import asyncore import asyncore
asyncore.dispatcher.log_info=log_info asyncore.dispatcher.log_info=log_info
except:
pass
# A routine to try to arrange for request sockets to be closed # A routine to try to arrange for request sockets to be closed
# on exec. This makes it easier for folks who spawn long running # on exec. This makes it easier for folks who spawn long running
# processes from Zope code. Thanks to Dieter Maurer for this. # processes from Zope code. Thanks to Dieter Maurer for this.
try: try:
import fcntl import fcntl
try:
from fcntl import F_SETFD, FD_CLOEXEC
except ImportError:
from FCNTL import F_SETFD, FD_CLOEXEC
def requestCloseOnExec(sock): def requestCloseOnExec(sock):
try: fcntl.fcntl(sock.fileno(), F_SETFD, FD_CLOEXEC) try:
except: pass fcntl.fcntl(sock.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
except: # XXX What was this supposed to catch?
pass
except (ImportError, AttributeError): except (ImportError, AttributeError):
......
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