mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 19:31:54 +08:00
Fix mxDateTime import for version 2.0.0 (now mx.DateTime).
This commit is contained in:
@ -61,10 +61,14 @@ type_conv = { FIELD_TYPE.TINY: int,
|
||||
FIELD_TYPE.YEAR: int }
|
||||
|
||||
try:
|
||||
try: from mx import DateTime # new packaging
|
||||
except ImportError: import DateTime # old packaging
|
||||
from DateTime import Date, Time, Timestamp, ISO, \
|
||||
DateTimeType, DateTimeDeltaType
|
||||
try:
|
||||
from mx import DateTime # new packaging
|
||||
from mx.DateTime import Date, Time, Timestamp, ISO, \
|
||||
DateTimeType, DateTimeDeltaType
|
||||
except ImportError:
|
||||
import DateTime # old packaging
|
||||
from DateTime import Date, Time, Timestamp, ISO, \
|
||||
DateTimeType, DateTimeDeltaType
|
||||
|
||||
def DateFromTicks(ticks):
|
||||
return apply(Date, localtime(ticks)[:3])
|
||||
|
Reference in New Issue
Block a user