Skip to content

Commit 32d0ac4

Browse files
Catch broader FileConfigError rather than FileDecodeError in is_used
This won't make any material difference, but makes more sense conceptually.
1 parent 607b581 commit 32d0ac4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/usethis/_tool/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from usethis._tool.config import ConfigSpec, NoConfigValue
3030
from usethis._tool.pre_commit import PreCommitConfig
3131
from usethis._tool.rule import RuleConfig
32-
from usethis.errors import FileDecodeError
32+
from usethis.errors import FileConfigError
3333

3434
if TYPE_CHECKING:
3535
from pathlib import Path
@@ -109,7 +109,7 @@ def is_used(self) -> bool:
109109
2. Whether any of the tool's managed files are in the project.
110110
3. Whether any of the tool's managed config file sections are present.
111111
"""
112-
decode_err_by_name: dict[str, FileDecodeError] = {}
112+
decode_err_by_name: dict[str, FileConfigError] = {}
113113
_is_used = False
114114

115115
_is_used = any(
@@ -119,13 +119,13 @@ def is_used(self) -> bool:
119119
if not _is_used:
120120
try:
121121
_is_used = self.is_declared_as_dep()
122-
except FileDecodeError as err:
122+
except FileConfigError as err:
123123
decode_err_by_name[err.name] = err
124124

125125
if not _is_used:
126126
try:
127127
_is_used = self.is_config_present()
128-
except FileDecodeError as err:
128+
except FileConfigError as err:
129129
decode_err_by_name[err.name] = err
130130

131131
for name, decode_err in decode_err_by_name.items():

0 commit comments

Comments
 (0)