~cjwatson/storm/psycopg2-missing-diag

« back to all changes in this revision

Viewing changes to storm/databases/sqlite.py

  • Committer: Colin Watson
  • Author(s): Thiago Bellini
  • Date: 2019-06-07 12:20:07 UTC
  • mfrom: (503.1.1 no-sys-maxint)
  • Revision ID: cjwatson@canonical.com-20190607122007-yf8y3rnhhsdcijuz
Use sys.maxsize rather than sys.maxint. [r=cjwatson]

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
def compile_select_sqlite(compile, select, state):
52
52
    if select.offset is not Undef and select.limit is Undef:
53
53
        if sys.maxsize > 2**32:
54
 
            # On 64-bit platforms sqlite doesn't like maxint as LIMIT. See also
 
54
            # On 64-bit platforms sqlite doesn't like maxsize as LIMIT. See
 
55
            # also
55
56
            # https://lists.ubuntu.com/archives/storm/2013-June/001492.html
56
 
            select.limit = sys.maxint - 1
 
57
            select.limit = sys.maxsize - 1
57
58
        else:
58
 
            select.limit = sys.maxint
 
59
            select.limit = sys.maxsize
59
60
    statement = compile_select(compile, select, state)
60
61
    if state.context is SELECT:
61
62
        # SQLite breaks with (SELECT ...) UNION (SELECT ...), so we