Skip to content

Commit

Permalink
Removing catch of UnboundLocalError exception
Browse files Browse the repository at this point in the history
The previous commit added an exception catch for
UnboundLocalError because regression testing
revealed a failure in handling the Asia/Jerusalem
timezone. This timezone uses the version 3 data
format. A new issue #672 was opened to ask for
support for version 3. Since that issue has now
been fixed, we no longer need to catch
UnboundLocalError.

Refs: #654
  • Loading branch information
SteveErl authored and linuxdude42 committed Jan 22, 2023
1 parent e4c55b5 commit ebcf061
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mythtv/programs/scripts/metadata/Television/tvmaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,8 @@ def buildNumbers(args, opts):
else:
show_tz = None
dtInTgtZone = dtInLocalZone.astimezone(posixtzinfo(show_tz))
# For at least one timezone, the following exception may be thrown.
# UnboundLocalError: local variable 'ttmfmt' referenced before assignment
# Example: tvmaze.py --debug -N "The Masked Singer" "2022-11-24 19:00:00"

except (ValueError, AttributeError, UnboundLocalError) as e:
except (ValueError, AttributeError) as e:
if opts.debug:
print('show_tz =%s, except = %s' % (show_tz, e))
dtInTgtZone = None
Expand Down

0 comments on commit ebcf061

Please sign in to comment.