diff options
| author | niemeyer <> | 2005-02-22 23:58:09 +0000 |
|---|---|---|
| committer | niemeyer <> | 2005-02-22 23:58:09 +0000 |
| commit | 5912df38d3a7325e652f4ccb7bd89cf21bdb9f43 (patch) | |
| tree | 96435c8c6c34d1396f2baa3d2ea01f8a13f7a7b8 /dateutil/parser.py | |
| parent | c5a085a9a30758770baaaba66b9cab66850ec21d (diff) | |
| download | dateutil-5912df38d3a7325e652f4ccb7bd89cf21bdb9f43.tar.gz | |
Accept parserinfo instances as the parser parameter.
Diffstat (limited to 'dateutil/parser.py')
| -rw-r--r-- | dateutil/parser.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dateutil/parser.py b/dateutil/parser.py index c1f74c4..020443c 100644 --- a/dateutil/parser.py +++ b/dateutil/parser.py @@ -283,8 +283,13 @@ class parserinfo: class parser: - def __init__(self, parserinfo=parserinfo): - self.info = parserinfo() + def __init__(self, info=parserinfo): + if issubclass(info, parserinfo): + self.info = parserinfo() + elif isinstance(info, parserinfo): + self.info = info + else: + raise TypeError, "Unsupported parserinfo type" def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, |
