]> git.tokkee.org Git - roundup.git/commitdiff

Code

handle FutureWarning not existing in py <2.3
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 6 Feb 2003 09:40:21 +0000 (09:40 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 6 Feb 2003 09:40:21 +0000 (09:40 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1489 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/backends/locking.py

index 634c14c79aee0fb57dfb713fe913db56931fb8bd..3899253b61f7dae905ecaceb6c75d4971ccc23d3 100644 (file)
@@ -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