Skip to content

Commit

Permalink
[bugfix] Do not pass None to Timestamp.fromtimestampformat()
Browse files Browse the repository at this point in the history
Bug: T354281
Change-Id: I1e612266e0f5b7b6a55cc99eb56e72bca3861261
  • Loading branch information
xqt committed Jan 3, 2024
1 parent bf5b373 commit e7e45e1
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions pywikibot/pagegenerators/_factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""GeneratorFactory module wich handles pagegenerators options."""
#
# (C) Pywikibot team, 2008-2023
# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
#
Expand Down Expand Up @@ -413,14 +413,13 @@ def parse_start(start: str | None
'positive int.'.format(start))
return None

try:
end = pywikibot.Timestamp.fromtimestampformat(end)
except ValueError as err:
pywikibot.error(
f'{err}. End parameter has wrong format!')
return None
except TypeError: # end is None
pass
if end is not None:
try:
end = pywikibot.Timestamp.fromtimestampformat(end)
except ValueError as err:
pywikibot.error(
f'{err}. End parameter has wrong format!')
return None

if start or end:
pywikibot.info('Fetching log events in range: {} - {}.'
Expand Down

0 comments on commit e7e45e1

Please sign in to comment.