mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-25 03:38:26 +02:00
Use types instead of imp.new_module.
I can follow up with https://docs.python.org/3/library/importlib.html#importlib.util.module_from_spec if need be.
This commit is contained in:
parent
ec2018d664
commit
ff45dd86fb
@ -1,6 +1,6 @@
|
|||||||
import sys
|
import sys
|
||||||
import zlib
|
import zlib
|
||||||
import imp
|
import types
|
||||||
|
|
||||||
verbosity = verbosity # noqa: F821 must be a previously defined global
|
verbosity = verbosity # noqa: F821 must be a previously defined global
|
||||||
z = zlib.decompressobj()
|
z = zlib.decompressobj()
|
||||||
@ -15,7 +15,7 @@ while 1:
|
|||||||
% (name, nbytes))
|
% (name, nbytes))
|
||||||
content = z.decompress(sys.stdin.read(nbytes))
|
content = z.decompress(sys.stdin.read(nbytes))
|
||||||
|
|
||||||
module = imp.new_module(name)
|
module = types.ModuleType(name)
|
||||||
parents = name.rsplit(".", 1)
|
parents = name.rsplit(".", 1)
|
||||||
if len(parents) == 2:
|
if len(parents) == 2:
|
||||||
parent, parent_name = parents
|
parent, parent_name = parents
|
||||||
|
Loading…
Reference in New Issue
Block a user