Have AssertionRewritingHook derive from importlib.abc.MetaPathFinder
This is nice for self-documentation, and is the type required by mypy for adding to sys.meta_path.
This commit is contained in:
parent
0f11a7a73d
commit
28761c8da1
|
@ -2,6 +2,7 @@
|
||||||
import ast
|
import ast
|
||||||
import errno
|
import errno
|
||||||
import functools
|
import functools
|
||||||
|
import importlib.abc
|
||||||
import importlib.machinery
|
import importlib.machinery
|
||||||
import importlib.util
|
import importlib.util
|
||||||
import io
|
import io
|
||||||
|
@ -37,7 +38,7 @@ AST_IS = ast.Is()
|
||||||
AST_NONE = ast.NameConstant(None)
|
AST_NONE = ast.NameConstant(None)
|
||||||
|
|
||||||
|
|
||||||
class AssertionRewritingHook:
|
class AssertionRewritingHook(importlib.abc.MetaPathFinder):
|
||||||
"""PEP302/PEP451 import hook which rewrites asserts."""
|
"""PEP302/PEP451 import hook which rewrites asserts."""
|
||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
|
|
Loading…
Reference in New Issue