From 253bf2b9c231d11a6b0b2f746261a440c8c4b63e Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 18 Jun 2003 23:31:52 +0000 Subject: [PATCH] - handle deprecation of FCNTL in python2.2+ git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1732 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/mailgw.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.30.2