[Zope-Checkins] CVS: Zope/ZServer/medusa - asyncore.py:1.16.12.2

Brian Lloyd brian@zope.com
Thu, 20 Jun 2002 09:58:50 -0400


Update of /cvs-repository/Zope/ZServer/medusa
In directory cvs.zope.org:/tmp/cvs-serv16589

Modified Files:
      Tag: Zope-2_5-branch
	asyncore.py 
Log Message:
Backported fix for #151


=== Zope/ZServer/medusa/asyncore.py 1.16.12.1 => 1.16.12.2 ===
     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.