Merge lp:~cjwatson/storm/syntax-warnings into lp:storm

Proposed by Colin Watson
Status: Merged
Merged at revision: 581
Proposed branch: lp:~cjwatson/storm/syntax-warnings
Merge into: lp:storm
Diff against target: 154 lines (+22/-14)
5 files modified
NEWS (+8/-0)
storm/cache.py (+3/-3)
storm/database.py (+2/-2)
storm/store.py (+1/-1)
storm/tests/expr.py (+8/-8)
To merge this branch: bzr merge lp:~cjwatson/storm/syntax-warnings
Reviewer Review Type Date Requested Status
Guruprasad Approve
Review via email: mp+457076@code.launchpad.net

Commit message

Fix several syntax warnings from recent Python versions.

Description of the change

Noticed while updating the Debian packaging.

To post a comment you must log in.
Revision history for this message
Guruprasad (lgp171188) wrote :

LGTM 👍

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2023-07-04 13:55:37 +0000
+++ NEWS 2023-12-07 17:05:38 +0000
@@ -1,3 +1,11 @@
10.27
2====
3
4Improvements
5------------
6
7- Fix several syntax warnings from recent Python versions.
8
10.26 (2023-07-04)90.26 (2023-07-04)
2=================10=================
311
412
=== modified file 'storm/cache.py'
--- storm/cache.py 2020-05-26 10:37:54 +0000
+++ storm/cache.py 2023-12-07 17:05:38 +0000
@@ -11,7 +11,7 @@
11 This prevents recently used objects from being deallocated by Python11 This prevents recently used objects from being deallocated by Python
12 even if the user isn't holding any strong references to it. It does12 even if the user isn't holding any strong references to it. It does
13 that by holding strong references to the objects referenced by the13 that by holding strong references to the objects referenced by the
14 last C{N} C{obj_info}\ s added to it (where C{N} is the cache size).14 last C{N} C{obj_info}\\ s added to it (where C{N} is the cache size).
15 """15 """
1616
17 def __init__(self, size=1000):17 def __init__(self, size=1000):
@@ -54,7 +54,7 @@
54 def set_size(self, size):54 def set_size(self, size):
55 """Set the maximum number of objects that may be held in this cache.55 """Set the maximum number of objects that may be held in this cache.
5656
57 If the size is reduced, older C{obj_info}\ s may be dropped from57 If the size is reduced, older C{obj_info}\\ s may be dropped from
58 the cache to respect the new size.58 the cache to respect the new size.
59 """59 """
60 if size == 0:60 if size == 0:
@@ -66,7 +66,7 @@
66 self._size = size66 self._size = size
6767
68 def get_cached(self):68 def get_cached(self):
69 """Return an ordered list of the currently cached C{obj_info}\ s.69 """Return an ordered list of the currently cached C{obj_info}\\ s.
7070
71 The most recently added objects come first in the list.71 The most recently added objects come first in the list.
72 """72 """
7373
=== modified file 'storm/database.py'
--- storm/database.py 2020-05-26 10:37:54 +0000
+++ storm/database.py 2023-12-07 17:05:38 +0000
@@ -377,7 +377,7 @@
377 self._check_disconnect(trace, "connection_commit", self, xid)377 self._check_disconnect(trace, "connection_commit", self, xid)
378378
379 def recover(self):379 def recover(self):
380 """Return a list of L{Xid}\ s representing pending transactions."""380 """Return a list of L{Xid}\\ s representing pending transactions."""
381 self._ensure_connected()381 self._ensure_connected()
382 raw_xids = self._check_disconnect(self._raw_connection.tpc_recover)382 raw_xids = self._check_disconnect(self._raw_connection.tpc_recover)
383 return [Xid(raw_xid[0], raw_xid[1], raw_xid[2])383 return [Xid(raw_xid[0], raw_xid[1], raw_xid[2])
@@ -423,7 +423,7 @@
423 is not intended to be used externally.423 is not intended to be used externally.
424424
425 This delegates conversion to any425 This delegates conversion to any
426 L{Variable <storm.variable.Variable>}\ s in the parameter list, and426 L{Variable <storm.variable.Variable>}\\ s in the parameter list, and
427 passes through all other values untouched.427 passes through all other values untouched.
428 """428 """
429 for param in params:429 for param in params:
430430
=== modified file 'storm/store.py'
--- storm/store.py 2020-05-29 23:08:57 +0000
+++ storm/store.py 2023-12-07 17:05:38 +0000
@@ -1865,7 +1865,7 @@
18651865
1866class block_access(object):1866class block_access(object):
1867 """1867 """
1868 Context manager blocks database access by one or more L{Store}\ s in the1868 Context manager blocks database access by one or more L{Store}\\ s in the
1869 managed scope.1869 managed scope.
1870 """1870 """
18711871
18721872
=== modified file 'storm/tests/expr.py'
--- storm/tests/expr.py 2022-10-18 17:36:05 +0000
+++ storm/tests/expr.py 2023-12-07 17:05:38 +0000
@@ -142,7 +142,7 @@
142 self.assertIdentical(expr.compile_cache, None)142 self.assertIdentical(expr.compile_cache, None)
143143
144 # Test for identity. We don't want False there.144 # Test for identity. We don't want False there.
145 self.assertTrue(expr.primary is 0)145 self.assertIs(expr.primary, 0)
146146
147 self.assertEqual(expr.variable_factory, Variable)147 self.assertEqual(expr.variable_factory, Variable)
148148
@@ -154,7 +154,7 @@
154 self.assertEqual(expr.table, objects[1])154 self.assertEqual(expr.table, objects[1])
155155
156 # Test for identity. We don't want True there either.156 # Test for identity. We don't want True there either.
157 self.assertTrue(expr.primary is 1)157 self.assertIs(expr.primary, 1)
158158
159 self.assertEqual(expr.variable_factory, objects[3])159 self.assertEqual(expr.variable_factory, objects[3])
160160
@@ -195,7 +195,7 @@
195195
196 like_expr = expr.startswith(u"abc!!_%")196 like_expr = expr.startswith(u"abc!!_%")
197 self.assertTrue(isinstance(like_expr, Like))197 self.assertTrue(isinstance(like_expr, Like))
198 self.assertTrue(like_expr.expr1 is expr)198 self.assertIs(like_expr.expr1, expr)
199 self.assertEqual(like_expr.expr2, u"abc!!!!!_!%%")199 self.assertEqual(like_expr.expr2, u"abc!!!!!_!%%")
200 self.assertEqual(like_expr.escape, u"!")200 self.assertEqual(like_expr.escape, u"!")
201201
@@ -214,7 +214,7 @@
214214
215 like_expr = expr.endswith(u"abc!!_%")215 like_expr = expr.endswith(u"abc!!_%")
216 self.assertTrue(isinstance(like_expr, Like))216 self.assertTrue(isinstance(like_expr, Like))
217 self.assertTrue(like_expr.expr1 is expr)217 self.assertIs(like_expr.expr1, expr)
218 self.assertEqual(like_expr.expr2, u"%abc!!!!!_!%")218 self.assertEqual(like_expr.expr2, u"%abc!!!!!_!%")
219 self.assertEqual(like_expr.escape, u"!")219 self.assertEqual(like_expr.escape, u"!")
220220
@@ -234,7 +234,7 @@
234234
235 like_expr = expr.contains_string(u"abc!!_%")235 like_expr = expr.contains_string(u"abc!!_%")
236 self.assertTrue(isinstance(like_expr, Like))236 self.assertTrue(isinstance(like_expr, Like))
237 self.assertTrue(like_expr.expr1 is expr)237 self.assertIs(like_expr.expr1, expr)
238 self.assertEqual(like_expr.expr2, u"%abc!!!!!_!%%")238 self.assertEqual(like_expr.expr2, u"%abc!!!!!_!%%")
239 self.assertEqual(like_expr.escape, u"!")239 self.assertEqual(like_expr.escape, u"!")
240240
@@ -1199,7 +1199,7 @@
1199 def test_eq_none(self):1199 def test_eq_none(self):
1200 expr = Func1() == None1200 expr = Func1() == None
12011201
1202 self.assertTrue(expr.expr2 is None)1202 self.assertIsNone(expr.expr2)
12031203
1204 state = State()1204 state = State()
1205 statement = compile(expr, state)1205 statement = compile(expr, state)
@@ -1222,7 +1222,7 @@
1222 def test_ne_none(self):1222 def test_ne_none(self):
1223 expr = Func1() != None1223 expr = Func1() != None
12241224
1225 self.assertTrue(expr.expr2 is None)1225 self.assertIsNone(expr.expr2)
12261226
1227 state = State()1227 state = State()
1228 statement = compile(expr, state)1228 statement = compile(expr, state)
@@ -2519,4 +2519,4 @@
2519 expr = SQL("Hullah!")2519 expr = SQL("Hullah!")
2520 variable = Variable()2520 variable = Variable()
2521 variable.set(expr)2521 variable.set(expr)
2522 self.assertTrue(variable.get(marker) is marker)2522 self.assertIs(variable.get(marker), marker)

Subscribers

People subscribed via source and target branches

to status/vote changes: