[Checkins] SVN: relstorage/trunk/relstorage/adapters/txncontrol.py Restored some logic specific to usage of the max() function.

Shane Hathaway shane at hathawaymix.org
Fri Sep 17 03:42:24 EDT 2010


Log message for revision 116480:
  Restored some logic specific to usage of the max() function.
  

Changed:
  U   relstorage/trunk/relstorage/adapters/txncontrol.py

-=-
Modified: relstorage/trunk/relstorage/adapters/txncontrol.py
===================================================================
--- relstorage/trunk/relstorage/adapters/txncontrol.py	2010-09-17 07:37:03 UTC (rev 116479)
+++ relstorage/trunk/relstorage/adapters/txncontrol.py	2010-09-17 07:42:23 UTC (rev 116480)
@@ -166,14 +166,6 @@
             conn.prepare()
         return '-'
 
-    def _parse_dsinterval(self, s):
-        """Convert an Oracle dsinterval (as a string) to a float."""
-        mo = re.match(r'([+-]\d+) (\d+):(\d+):([0-9.]+)', s)
-        if not mo:
-            raise ValueError(s)
-        day, hour, min, sec = [float(v) for v in mo.groups()]
-        return day * 86400 + hour * 3600 + min * 60 + sec
-
     def get_tid(self, cursor):
         """Returns the most recent tid.
         """
@@ -196,7 +188,10 @@
                 return 0
 
         assert len(rows) == 1
-        return rows[0][0]
+        tid = rows[0][0]
+        if tid is None:
+            tid = 0
+        return tid
 
     def add_transaction(self, cursor, tid, username, description, extension,
             packed=False):



More information about the checkins mailing list