Skip to content

Commit

Permalink
Do not traceback when setting the original locale fails
Browse files Browse the repository at this point in the history
Signed-off-by: Nikola Forró <nforro@redhat.com>
  • Loading branch information
nforro committed Aug 9, 2021
1 parent be84e4e commit 8895c0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rebasehelper/specfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,11 @@ def get_new_log(self, changelog_entry):
locale.setlocale(locale.LC_TIME, "C")
day=today.strftime('%a %b %d %Y')
finally:
locale.setlocale(locale.LC_TIME, old_locale)
try:
locale.setlocale(locale.LC_TIME, old_locale)
except locale.Error:
# we can't really do anything reasonable here, just keep the C locale
pass
new_record.append('* {day} {name} <{email}> - {evr}'.format(day=day,
name=GitHelper.get_user(),
email=GitHelper.get_email(),
Expand Down

0 comments on commit 8895c0f

Please sign in to comment.