From ca91be8154bd74c928e21e5bad700fe3f487330c Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Mon, 29 Aug 2022 01:27:26 +0100 Subject: [PATCH] twitter.archive: fix legacy config detection apparently .name contains the parent module so previously it was throwing the exception instead --- my/twitter/archive.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/my/twitter/archive.py b/my/twitter/archive.py index 9975e6e..5c37fd3 100644 --- a/my/twitter/archive.py +++ b/my/twitter/archive.py @@ -8,7 +8,8 @@ Twitter data (uses [[https://help.twitter.com/en/managing-your-account/how-to-do try: from my.config import twitter_archive as user_config except ImportError as ie: - if ie.name != 'twitter_archive': + if not (ie.name == 'my.config' and 'twitter_archive' in str(ie)): + # must be caused by something else raise ie try: from my.config import twitter as user_config # type: ignore[misc]