We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b055895 commit a50f6e2Copy full SHA for a50f6e2
setuptools/_static.py
@@ -24,15 +24,17 @@ class Static:
24
_mutated_: bool = False # TODO: Remove after deprecation warning is solved
25
26
27
-def _prevent_modification(target: type, method: str, copying: str):
+def _prevent_modification(target: type, method: str, copying: str) -> None:
28
"""
29
Because setuptools is very flexible we cannot fully prevent
30
plugins and user customisations from modifying static values that were
31
parsed from config files.
32
But we can attempt to block "in-place" mutations and identify when they
33
were done.
34
35
- fn = getattr(target, method)
+ fn = getattr(target, method, None)
36
+ if fn is None:
37
+ return
38
39
@wraps(fn)
40
def _replacement(self: Static, *args, **kwargs):
0 commit comments