From ed04ca9883828303b1d9a685f9327bd77dab8c38 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 6 Feb 2003 09:40:21 +0000 Subject: [PATCH] handle FutureWarning not existing in py <2.3 git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1489 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/backends/locking.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/roundup/backends/locking.py b/roundup/backends/locking.py index 634c14c..3899253 100644 --- a/roundup/backends/locking.py +++ b/roundup/backends/locking.py @@ -19,7 +19,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -# $Id: locking.py,v 1.3 2003-02-06 05:43:47 richard Exp $ +# $Id: locking.py,v 1.4 2003-02-06 09:40:21 richard Exp $ '''This module provides a generic interface to acquire and release exclusive access to a file. @@ -27,10 +27,15 @@ exclusive access to a file. It should work on Unix and Windows. ''' -import warnings -warnings.filterwarnings("ignore", - r'hex/oct constants > sys\.maxint .*', FutureWarning, - 'portalocker', 0) +try: + x=FutureWarning + import warnings + warnings.filterwarnings("ignore", + r'hex/oct constants > sys\.maxint .*', FutureWarning, + 'portalocker', 0) + del x +except: + pass import portalocker -- 2.39.5