From 100485f627be833caa11e68e4cf11d89db5fcd86 Mon Sep 17 00:00:00 2001 From: "jinuk84.kim" Date: Fri, 8 Nov 2013 11:51:31 +0900 Subject: microsecond-bug-fix for datetime.datetime --- MySQLdb/times.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MySQLdb/times.py b/MySQLdb/times.py index f3a92d7..4040f8e 100644 --- a/MySQLdb/times.py +++ b/MySQLdb/times.py @@ -51,7 +51,11 @@ def DateTime_or_None(s): try: d, t = s.split(sep, 1) - return datetime(*[ int(x) for x in d.split('-')+t.split(':') ]) + if '.' in t: + t, m = t.split('.',1) + else: + m = 0 + return datetime(*[ int(x) for x in d.split('-')+t.split(':')+[m] ]) except (SystemExit, KeyboardInterrupt): raise except: -- cgit v1.2.1