Skip to content

Commit bacb902

Browse files
author
Richard Jones
committed
handle FutureWarning not existing in py <2.3
1 parent 7e620df commit bacb902

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

roundup/backends/locking.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@
1919
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
# SOFTWARE.
2121

22-
# $Id: locking.py,v 1.3 2003-02-06 05:43:47 richard Exp $
22+
# $Id: locking.py,v 1.4 2003-02-06 09:40:21 richard Exp $
2323

2424
'''This module provides a generic interface to acquire and release
2525
exclusive access to a file.
2626
2727
It should work on Unix and Windows.
2828
'''
2929

30-
import warnings
31-
warnings.filterwarnings("ignore",
32-
r'hex/oct constants > sys\.maxint .*', FutureWarning,
33-
'portalocker', 0)
30+
try:
31+
x=FutureWarning
32+
import warnings
33+
warnings.filterwarnings("ignore",
34+
r'hex/oct constants > sys\.maxint .*', FutureWarning,
35+
'portalocker', 0)
36+
del x
37+
except:
38+
pass
3439

3540
import portalocker
3641

0 commit comments

Comments
 (0)