Merge lp:~cjwatson/storm/no-sys-maxint into lp:storm

Proposed by Colin Watson
Status: Merged
Merged at revision: 504
Proposed branch: lp:~cjwatson/storm/no-sys-maxint
Merge into: lp:storm
Diff against target: 45 lines (+6/-5)
3 files modified
storm/databases/sqlite.py (+4/-3)
storm/properties.py (+1/-1)
tests/mocker.py (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/storm/no-sys-maxint
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+368542@code.launchpad.net

Commit message

Use sys.maxsize rather than sys.maxint.

Description of the change

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

I'll review this myself since I just extracted it from somebody else's MP.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storm/databases/sqlite.py'
2--- storm/databases/sqlite.py 2019-06-05 11:41:07 +0000
3+++ storm/databases/sqlite.py 2019-06-07 12:19:20 +0000
4@@ -51,11 +51,12 @@
5 def compile_select_sqlite(compile, select, state):
6 if select.offset is not Undef and select.limit is Undef:
7 if sys.maxsize > 2**32:
8- # On 64-bit platforms sqlite doesn't like maxint as LIMIT. See also
9+ # On 64-bit platforms sqlite doesn't like maxsize as LIMIT. See
10+ # also
11 # https://lists.ubuntu.com/archives/storm/2013-June/001492.html
12- select.limit = sys.maxint - 1
13+ select.limit = sys.maxsize - 1
14 else:
15- select.limit = sys.maxint
16+ select.limit = sys.maxsize
17 statement = compile_select(compile, select, state)
18 if state.context is SELECT:
19 # SQLite breaks with (SELECT ...) UNION (SELECT ...), so we
20
21=== modified file 'storm/properties.py'
22--- storm/properties.py 2019-06-05 11:41:07 +0000
23+++ storm/properties.py 2019-06-07 12:19:20 +0000
24@@ -262,7 +262,7 @@
25 i += 1
26 else:
27 namespace_parts = ("." + namespace).split(".")
28- best_path_info = (0, sys.maxint)
29+ best_path_info = (0, sys.maxsize)
30 while i < l and self._properties[i][0].startswith(key):
31 path, prop_ref = self._properties[i]
32 prop = prop_ref()
33
34=== modified file 'tests/mocker.py'
35--- tests/mocker.py 2019-06-05 11:41:07 +0000
36+++ tests/mocker.py 2019-06-07 12:19:20 +0000
37@@ -1665,7 +1665,7 @@
38 def __init__(self, min, max=False):
39 self.min = min
40 if max is None:
41- self.max = sys.maxint
42+ self.max = sys.maxsize
43 elif max is False:
44 self.max = min
45 else:

Subscribers

People subscribed via source and target branches

to status/vote changes: