Commit 741b983d authored by Brian Lloyd's avatar Brian Lloyd

Fix for bug 151: Python 2.1 / 2.2 compatibility hack for fcntl wasn't

installed when using medusa directly (e.g. monitor_client).
parent 906c3b37
......@@ -518,6 +518,17 @@ import os
if os.name == 'posix':
import fcntl
# HACK by ZC: this hack also appears in ZServer.__init__, but it
# doesn't get installed if someone uses medusa directly (as they
# would when running the monitor client. This ensures that the
# compatibility hack is installed. Hopefully this (and any other)
# hacks can go away when we move to Python 2.2.
if not hasattr(fcntl, 'F_GETFL'):
import FCNTL
fcntl.F_GETFL = FCNTL.F_GETFL
fcntl.F_SETFL = FCNTL.F_SETFL
class file_wrapper:
# here we override just enough to make a file
# look like a socket for the purposes of asyncore.
......
......@@ -518,6 +518,17 @@ import os
if os.name == 'posix':
import fcntl
# HACK by ZC: this hack also appears in ZServer.__init__, but it
# doesn't get installed if someone uses medusa directly (as they
# would when running the monitor client. This ensures that the
# compatibility hack is installed. Hopefully this (and any other)
# hacks can go away when we move to Python 2.2.
if not hasattr(fcntl, 'F_GETFL'):
import FCNTL
fcntl.F_GETFL = FCNTL.F_GETFL
fcntl.F_SETFL = FCNTL.F_SETFL
class file_wrapper:
# here we override just enough to make a file
# look like a socket for the purposes of asyncore.
......
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