net-analyzer/theHarvester: fix errors with <=py3.6

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Yury Martynov <email@linxon.ru>
This commit is contained in:
Yury Martynov 2020-03-02 12:51:08 +03:00
parent 30a9f96417
commit 178cc8e10e
No known key found for this signature in database
GPG key ID: EBE62DD0CCEAE19E
2 changed files with 18 additions and 0 deletions

View file

@ -0,0 +1,16 @@
diff -ur a/theHarvester/__main__.py b/theHarvester/__main__.py
--- a/theHarvester/__main__.py 2019-10-14 23:48:56.000000000 +0300
+++ b/theHarvester/__main__.py 2020-03-02 12:46:37.460953085 +0300
@@ -489,7 +489,11 @@
print('---------------------')
all_hosts = sorted(list(set(all_hosts)))
full_host = hostchecker.Checker(all_hosts)
- full, ips = asyncio.run(full_host.check())
+ if sys.version_info[1] <= 6:
+ loop = asyncio.get_event_loop()
+ full, ips = loop.run_until_complete(full_host.check())
+ else:
+ full, ips = asyncio.run(full_host.check())
db = stash.stash_manager()
for host in full:
host = str(host)

View file

@ -38,6 +38,8 @@ DEPEND="${RDEPEND}"
# dev-python/mypy[${PYTHON_USEDEP}]
# )"
PATCHES=( "${FILESDIR}/${P}_fix_asyncio_detect.patch")
# distutils_enable_tests pytest
src_prepare() {