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
1=== modified file 'NEWS'
2--- NEWS 2023-07-04 13:55:37 +0000
3+++ NEWS 2023-12-07 17:05:38 +0000
4@@ -1,3 +1,11 @@
5+0.27
6+====
7+
8+Improvements
9+------------
10+
11+- Fix several syntax warnings from recent Python versions.
12+
13 0.26 (2023-07-04)
14 =================
15
16
17=== modified file 'storm/cache.py'
18--- storm/cache.py 2020-05-26 10:37:54 +0000
19+++ storm/cache.py 2023-12-07 17:05:38 +0000
20@@ -11,7 +11,7 @@
21 This prevents recently used objects from being deallocated by Python
22 even if the user isn't holding any strong references to it. It does
23 that by holding strong references to the objects referenced by the
24- last C{N} C{obj_info}\ s added to it (where C{N} is the cache size).
25+ last C{N} C{obj_info}\\ s added to it (where C{N} is the cache size).
26 """
27
28 def __init__(self, size=1000):
29@@ -54,7 +54,7 @@
30 def set_size(self, size):
31 """Set the maximum number of objects that may be held in this cache.
32
33- If the size is reduced, older C{obj_info}\ s may be dropped from
34+ If the size is reduced, older C{obj_info}\\ s may be dropped from
35 the cache to respect the new size.
36 """
37 if size == 0:
38@@ -66,7 +66,7 @@
39 self._size = size
40
41 def get_cached(self):
42- """Return an ordered list of the currently cached C{obj_info}\ s.
43+ """Return an ordered list of the currently cached C{obj_info}\\ s.
44
45 The most recently added objects come first in the list.
46 """
47
48=== modified file 'storm/database.py'
49--- storm/database.py 2020-05-26 10:37:54 +0000
50+++ storm/database.py 2023-12-07 17:05:38 +0000
51@@ -377,7 +377,7 @@
52 self._check_disconnect(trace, "connection_commit", self, xid)
53
54 def recover(self):
55- """Return a list of L{Xid}\ s representing pending transactions."""
56+ """Return a list of L{Xid}\\ s representing pending transactions."""
57 self._ensure_connected()
58 raw_xids = self._check_disconnect(self._raw_connection.tpc_recover)
59 return [Xid(raw_xid[0], raw_xid[1], raw_xid[2])
60@@ -423,7 +423,7 @@
61 is not intended to be used externally.
62
63 This delegates conversion to any
64- L{Variable <storm.variable.Variable>}\ s in the parameter list, and
65+ L{Variable <storm.variable.Variable>}\\ s in the parameter list, and
66 passes through all other values untouched.
67 """
68 for param in params:
69
70=== modified file 'storm/store.py'
71--- storm/store.py 2020-05-29 23:08:57 +0000
72+++ storm/store.py 2023-12-07 17:05:38 +0000
73@@ -1865,7 +1865,7 @@
74
75 class block_access(object):
76 """
77- Context manager blocks database access by one or more L{Store}\ s in the
78+ Context manager blocks database access by one or more L{Store}\\ s in the
79 managed scope.
80 """
81
82
83=== modified file 'storm/tests/expr.py'
84--- storm/tests/expr.py 2022-10-18 17:36:05 +0000
85+++ storm/tests/expr.py 2023-12-07 17:05:38 +0000
86@@ -142,7 +142,7 @@
87 self.assertIdentical(expr.compile_cache, None)
88
89 # Test for identity. We don't want False there.
90- self.assertTrue(expr.primary is 0)
91+ self.assertIs(expr.primary, 0)
92
93 self.assertEqual(expr.variable_factory, Variable)
94
95@@ -154,7 +154,7 @@
96 self.assertEqual(expr.table, objects[1])
97
98 # Test for identity. We don't want True there either.
99- self.assertTrue(expr.primary is 1)
100+ self.assertIs(expr.primary, 1)
101
102 self.assertEqual(expr.variable_factory, objects[3])
103
104@@ -195,7 +195,7 @@
105
106 like_expr = expr.startswith(u"abc!!_%")
107 self.assertTrue(isinstance(like_expr, Like))
108- self.assertTrue(like_expr.expr1 is expr)
109+ self.assertIs(like_expr.expr1, expr)
110 self.assertEqual(like_expr.expr2, u"abc!!!!!_!%%")
111 self.assertEqual(like_expr.escape, u"!")
112
113@@ -214,7 +214,7 @@
114
115 like_expr = expr.endswith(u"abc!!_%")
116 self.assertTrue(isinstance(like_expr, Like))
117- self.assertTrue(like_expr.expr1 is expr)
118+ self.assertIs(like_expr.expr1, expr)
119 self.assertEqual(like_expr.expr2, u"%abc!!!!!_!%")
120 self.assertEqual(like_expr.escape, u"!")
121
122@@ -234,7 +234,7 @@
123
124 like_expr = expr.contains_string(u"abc!!_%")
125 self.assertTrue(isinstance(like_expr, Like))
126- self.assertTrue(like_expr.expr1 is expr)
127+ self.assertIs(like_expr.expr1, expr)
128 self.assertEqual(like_expr.expr2, u"%abc!!!!!_!%%")
129 self.assertEqual(like_expr.escape, u"!")
130
131@@ -1199,7 +1199,7 @@
132 def test_eq_none(self):
133 expr = Func1() == None
134
135- self.assertTrue(expr.expr2 is None)
136+ self.assertIsNone(expr.expr2)
137
138 state = State()
139 statement = compile(expr, state)
140@@ -1222,7 +1222,7 @@
141 def test_ne_none(self):
142 expr = Func1() != None
143
144- self.assertTrue(expr.expr2 is None)
145+ self.assertIsNone(expr.expr2)
146
147 state = State()
148 statement = compile(expr, state)
149@@ -2519,4 +2519,4 @@
150 expr = SQL("Hullah!")
151 variable = Variable()
152 variable.set(expr)
153- self.assertTrue(variable.get(marker) is marker)
154+ self.assertIs(variable.get(marker), marker)

Subscribers

People subscribed via source and target branches

to status/vote changes: