From fd35357de0b6cfda1e5e74f3090cd8a11233ac50 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Wed, 2 Apr 2014 19:32:35 +0200 Subject: [PATCH] We should catch KeyboardInterrupt in __init__.py We don't catch it if someone install it via setup.py with the old fix. --- lib/svtplay_dl/__init__.py | 6 +++++- lib/svtplay_dl/__main__.py | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/svtplay_dl/__init__.py b/lib/svtplay_dl/__init__.py index 21f6b2a..b4e2e99 100644 --- a/lib/svtplay_dl/__init__.py +++ b/lib/svtplay_dl/__init__.py @@ -195,4 +195,8 @@ def main(): sys.exit(4) url = args[0] - get_media(url, options) + + try: + get_media(url, options) + except KeyboardInterrupt: + pass diff --git a/lib/svtplay_dl/__main__.py b/lib/svtplay_dl/__main__.py index 8bb66ea..78013d8 100644 --- a/lib/svtplay_dl/__main__.py +++ b/lib/svtplay_dl/__main__.py @@ -8,10 +8,7 @@ if __package__ is None and not hasattr(sys, "frozen"): import os.path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -try: import svtplay_dl if __name__ == '__main__': - svtplay_dl.main() -except KeyboardInterrupt: - pass + svtplay_dl.main() \ No newline at end of file