From: richard Date: Wed, 18 Jun 2003 23:31:52 +0000 (+0000) Subject: - handle deprecation of FCNTL in python2.2+ X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=253bf2b9c231d11a6b0b2f746261a440c8c4b63e;p=roundup.git - handle deprecation of FCNTL in python2.2+ git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1732 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/mailgw.py b/roundup/mailgw.py index ca9ed5a..e942fe8 100644 --- a/roundup/mailgw.py +++ b/roundup/mailgw.py @@ -73,7 +73,7 @@ are calling the create() method to create a new node). If an auditor raises an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.121 2003-04-27 02:16:46 richard Exp $ +$Id: mailgw.py,v 1.122 2003-06-18 23:31:52 richard Exp $ ''' import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri @@ -221,7 +221,12 @@ class MailGW: pass each to the mail handler. ''' # open the spool file and lock it - import fcntl, FCNTL + import fcntl + # FCNTL is deprecated in py2.3 and fcntl takes over all the symbols + if hasattr(fcntl, 'LOCK_EX'): + FCNTL = fcntl + else: + import FCNTL f = open(filename, 'r+') fcntl.flock(f.fileno(), FCNTL.LOCK_EX)