summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjinuk84.kim <jinuk84.kim@lge.com>2013-11-08 11:51:31 +0900
committerjinuk84.kim <jinuk84.kim@lge.com>2013-11-08 11:51:31 +0900
commit100485f627be833caa11e68e4cf11d89db5fcd86 (patch)
treeefd1811fd354ce5d6e716d7fff8f41b812a926bc
parentc8b2744ea2b1e4419b7e3d93928e92c95f366815 (diff)
downloadmysqldb1-100485f627be833caa11e68e4cf11d89db5fcd86.tar.gz
microsecond-bug-fix for datetime.datetime
-rw-r--r--MySQLdb/times.py6
1 files changed, 5 insertions, 1 deletions
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: