From daa7530a19b2de6dcadac4eb4b18cb5fe71d9e34 Mon Sep 17 00:00:00 2001 From: David Zurow Date: Wed, 6 Apr 2022 10:00:53 -0400 Subject: [PATCH] Update tda-generate-token.py to allow for manual flow Selenium currently appears to raise a generic Exception with no installed driver. Also, allow for running manual flow if no drivers are installed. --- bin/tda-generate-token.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tda-generate-token.py b/bin/tda-generate-token.py index 9b4c3c0..9223887 100755 --- a/bin/tda-generate-token.py +++ b/bin/tda-generate-token.py @@ -28,7 +28,8 @@ def main(api_key, redirect_uri, token_path): if driver is None: try: driver = webdriver.Safari() - except WebDriverException as e: + except Exception as e: + # Currently raises a generic Exception print('Failed to open Safari, continuing:', e) # Edge @@ -52,7 +53,6 @@ def main(api_key, redirect_uri, token_path): if driver is None: print('Failed to open any webdriver. See here for help: ' + 'https://tda-api.readthedocs.io/en/latest/help.html') - return -1 try: with driver: