From 8c2c0fa47a053c351f120e98dbea3a4eadb7035b Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Sun, 18 Oct 2020 20:25:54 +0000 Subject: [PATCH] Remove workaround for http://bugs.python.org/issue16308 as snscrape requires 3.8+ now anyway --- snscrape/_cli.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/snscrape/_cli.py b/snscrape/_cli.py index 3cbe8f5..bdcc71e 100644 --- a/snscrape/_cli.py +++ b/snscrape/_cli.py @@ -202,7 +202,7 @@ def parse_args(): parser.add_argument('--since', type = parse_datetime_arg, metavar = 'DATETIME', help = 'Only return results newer than DATETIME') parser.add_argument('--progress', action = 'store_true', default = False, help = 'Report progress on stderr') - subparsers = parser.add_subparsers(dest = 'scraper', help = 'The scraper you want to use') + subparsers = parser.add_subparsers(dest = 'scraper', help = 'The scraper you want to use', required = True) classes = snscrape.base.Scraper.__subclasses__() for cls in classes: if cls.name is not None: @@ -213,10 +213,6 @@ def parse_args(): args = parser.parse_args() - # http://bugs.python.org/issue16308 / https://bugs.python.org/issue26510 (fixed in Python 3.7) - if not args.scraper: - raise RuntimeError('Error: no scraper specified') - if not args.withEntity and args.maxResults == 0: parser.error('--max-results 0 is only valid when used with --with-entity')