Re: Bug with strptime in mxDateTime

"M.-A. Lemburg" <[email protected]> Mon, 13 Sep 2010 18:41:42 +0200
Newsgroups gmane.comp.python.egenix.user
Organization eGenix.com Software GmbH; http://www.egenix.com/
Message-ID <[email protected]>
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/


_______________________________________________________________________
eGenix.com User Mailing List                     http://www.egenix.com/
https://www.egenix.com/mailman/listinfo/egenix-users