[egenix-users] Bug with strptime in mxDateTime

M.-A. Lemburg mal at egenix.com
Mon Sep 13 19:41:42 CEST 2010


Alok Singhal wrote:
> Hi,
> 
> I am using egenix DateTime module, version 3.1.3.  In
> mx/DateTime/mxDateTime/__init__.py, there's a check for strptime:
> 
> # If strptime() is not available, use the time.strptime() as
> # work-around, if that is available
> try:
>     strptime
>     raise NameError
> except NameError:
>     if hasattr(time, 'strptime'):
>         def strptime(string, format,
>                      _time=time):
>             return DateTime(*_time.strptime(string, format)[:6])
> 
> The code in the 'try' clause above raises NameError whether or not the
> name 'strptime' exists.  The line
> 
>     raise NameError
> 
> should not be there.

Thanks for bringing this to our attention.

This was obviously a left-over from a debugging session.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Sep 13 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2010-08-19: Released mxODBC 3.1.0              http://python.egenix.com/
2010-09-15: DZUG Tagung, Dresden, Germany                   2 days to go

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the egenix-users mailing list