Skip to content

Commit 31eeb60

Browse files
authored
Fix invalid escape sequence warning in Python 3.12 (#1420)
* Fix syntax warning * Update the ruff rules to check for warnings
1 parent 9264f02 commit 31eeb60

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bitsandbytes/cextension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_cuda_bnb_library_path(cuda_specs: CUDASpecs) -> Path:
4545

4646
override_value = os.environ.get("BNB_CUDA_VERSION")
4747
if override_value:
48-
library_name = re.sub("cuda\d+", f"cuda{override_value}", library_name, count=1)
48+
library_name = re.sub(r"cuda\d+", f"cuda{override_value}", library_name, count=1)
4949
logger.warning(
5050
f"WARNING: BNB_CUDA_VERSION={override_value} environment variable detected; loading {library_name}.\n"
5151
"This can be used to load a bitsandbytes version that is different from the PyTorch CUDA version.\n"

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ line-length = 119
1414
[tool.ruff.lint]
1515
select = [
1616
"B", # bugbear: security warnings
17-
"E", # pycodestyle
17+
"E", # pycodestyle (error)
18+
"W", # pycodestyle (warning)
1819
"F", # pyflakes
1920
"I", # isort
2021
"ISC", # implicit string concatenation

0 commit comments

Comments
 (0)