Skip to content

Commit

Permalink
Avoid crash when displaying properties and yaml module is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Nov 11, 2015
1 parent f657685 commit af68081
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions guessit/__main__.py
Expand Up @@ -114,16 +114,16 @@ def main(args=None): # pylint:disable=too-many-branches
print('+-------------------------------------------------------+')
help_required = False

if options.properties or options.values:
display_properties(options)
help_required = False

if options.yaml:
try:
import yaml # pylint:disable=unused-variable
except ImportError: # pragma: no cover
options.yaml = False
print('PyYAML not found. Using default output.')
print('PyYAML is not installed. \'--yaml\' option will be ignored ...', file=sys.stderr)

if options.properties or options.values:
display_properties(options)
help_required = False

filenames = []
if options.filename:
Expand Down

0 comments on commit af68081

Please sign in to comment.