From 8f9569edd9dc4bbd5cd0c36ad178a5a5aa725f40 Mon Sep 17 00:00:00 2001 From: monosans Date: Tue, 21 Feb 2023 21:22:47 +0300 Subject: [PATCH] Fix errors on Python 3.7/3.8 Fixes #40 --- README.md | 2 +- proxy_scraper_checker/__main__.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 21f31cd..e5482b8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ You can get proxies obtained using this script in [monosans/proxy-list](https:// - Download and unpack [the archive with the program](https://github.com/monosans/proxy-scraper-checker/archive/refs/heads/main.zip). - Edit `config.ini` according to your preference. -- Install [Python](https://python.org/downloads) (Windows 7 requires Python 3.8.X). During installation, be sure to check the box `Add Python to PATH`. +- Install [Python](https://python.org/downloads) (minimum supported version is 3.7). During installation, be sure to check the box `Add Python to PATH`. - Install dependencies and run the script. There are 2 ways to do this: - Automatic: - On Windows run `start.cmd` diff --git a/proxy_scraper_checker/__main__.py b/proxy_scraper_checker/__main__.py index efc1e61..96de7e3 100644 --- a/proxy_scraper_checker/__main__.py +++ b/proxy_scraper_checker/__main__.py @@ -50,17 +50,16 @@ def get_config(file: str) -> ConfigParser: return cfg -def main() -> None: - set_event_loop_policy() - +async def main() -> None: cfg = get_config("config.ini") console = Console() configure_logging(console, debug=cfg["General"].getboolean("Debug", False)) psc = ProxyScraperChecker.from_configparser(cfg, console=console) - asyncio.run(psc.run()) + await psc.run() if __name__ == "__main__": - main() + set_event_loop_policy() + asyncio.run(main())