mirror of https://github.com/n1nj4sec/pupy.git
Fix crash during idna cleanup
This commit is contained in:
parent
26e9f464d0
commit
fba47eee4f
|
@ -41,7 +41,9 @@ if not hasattr(os, 'stdout_write'):
|
|||
|
||||
# Remove IDNA module if it was not properly loaded
|
||||
if hasattr(encodings, 'idna') and not hasattr(encodings.idna, 'getregentry'):
|
||||
del sys.modules['encodings.idna']
|
||||
if 'encodings.idna' in sys.modules:
|
||||
del sys.modules['encodings.idna']
|
||||
|
||||
if 'idna' in encodings._cache:
|
||||
del encodings._cache['idna']
|
||||
|
||||
|
|
Loading…
Reference in New Issue