diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ba384130..4888bbceb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.0.255" + rev: "v0.0.257" hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/src/uproot/language/python.py b/src/uproot/language/python.py index a5d31fbb8..f481879f9 100644 --- a/src/uproot/language/python.py +++ b/src/uproot/language/python.py @@ -422,6 +422,7 @@ def compute_expressions( warnings.warn( f"{x!r} is both an alias and a branch name", uproot.exceptions.NameConflictWarning, + stacklevel=1, ) def getter(name): diff --git a/src/uproot/reading.py b/src/uproot/reading.py index fd0e6c4ee..289ed395f 100644 --- a/src/uproot/reading.py +++ b/src/uproot/reading.py @@ -168,7 +168,7 @@ def __getitem__(self, where): open.defaults["xrootd_handler"] = uproot.MultithreadedXRootDSource """ ) - warnings.warn(message, FutureWarning) + warnings.warn(message, FutureWarning, stacklevel=1) # The key should still be set, regardless of whether we see the warning. self["xrootd_handler"] = uproot.source.xrootd.XRootDSource