Commit 0896cba7 authored by Andreas Jung's avatar Andreas Jung

wrapped the complete DateTime parser magic into try..except

for a better and unique error handling
parent fc3032e7
......@@ -497,6 +497,15 @@ class DateTime:
SyntaxError = SyntaxError
def __init__(self,*args, **kw):
"""Return a new date-time object"""
try:
return self._parse_args(*args, **kw)
except:
raise SyntaxError('Unable to parse %s, %s' % (args, kw))
def _parse_args(self, *args, **kw):
"""Return a new date-time object
A DateTime object always maintains its value as an absolute
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment