mirror of
https://github.com/pybind/pybind11.git
synced 2026-07-11 01:26:58 +00:00
chore(setup_helpers): remove dead cpp_flag_cache and fix parameter typo (#6085)
Remove the module-level `cpp_flag_cache = None` variable and its stale comment "Every call will cache the result". The actual caching is handled by the `@lru_cache` decorator on `auto_cpp_level` directly below. Also rename the typo'd parameter `obg` to `obj` in `no_recompile`. Nothing passes this argument by keyword, so there is no API break. Part of #6084 Assisted-by: ClaudeCode:claude-sonnet-4-6
This commit is contained in:
@@ -245,10 +245,6 @@ def has_flag(compiler: Any, flag: str) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
# Every call will cache the result
|
||||
cpp_flag_cache = None
|
||||
|
||||
|
||||
@lru_cache
|
||||
def auto_cpp_level(compiler: Any) -> str | int:
|
||||
"""
|
||||
@@ -338,7 +334,7 @@ def naive_recompile(obj: str, src: str) -> bool:
|
||||
return os.stat(obj).st_mtime < os.stat(src).st_mtime
|
||||
|
||||
|
||||
def no_recompile(obg: str, src: str) -> bool: # noqa: ARG001
|
||||
def no_recompile(obj: str, src: str) -> bool: # noqa: ARG001
|
||||
"""
|
||||
This is the safest but slowest choice (and is the default) - will always
|
||||
recompile sources.
|
||||
|
||||
Reference in New Issue
Block a user