[Checkins] SVN: relstorage/trunk/relstorage/adapters/oidallocator.py Use floor division.
Shane Hathaway
shane at hathawaymix.org
Fri Sep 30 16:30:52 EST 2011
Log message for revision 123003:
Use floor division.
Changed:
U relstorage/trunk/relstorage/adapters/oidallocator.py
-=-
Modified: relstorage/trunk/relstorage/adapters/oidallocator.py
===================================================================
--- relstorage/trunk/relstorage/adapters/oidallocator.py 2011-09-30 19:46:42 UTC (rev 123002)
+++ relstorage/trunk/relstorage/adapters/oidallocator.py 2011-09-30 21:30:52 UTC (rev 123003)
@@ -27,7 +27,7 @@
def set_min_oid(self, cursor, oid):
"""Ensure the next OID is at least the given OID."""
- n = (oid + 15) / 16
+ n = (oid + 15) // 16
cursor.execute("""
SELECT CASE WHEN %s > nextval('zoid_seq')
THEN setval('zoid_seq', %s)
@@ -48,7 +48,7 @@
def set_min_oid(self, cursor, oid):
"""Ensure the next OID is at least the given OID."""
- n = (oid + 15) / 16
+ n = (oid + 15) // 16
cursor.execute("REPLACE INTO new_oid VALUES(%s)", (n,))
def new_oids(self, cursor):
@@ -71,7 +71,7 @@
def set_min_oid(self, cursor, oid):
"""Ensure the next OID is at least the given OID."""
- n = (oid + 15) / 16
+ n = (oid + 15) // 16
stmt = "SELECT zoid_seq.nextval FROM DUAL"
cursor.execute(stmt)
next_n = cursor.fetchone()[0]
More information about the checkins
mailing list