Skip to content

Commit 9ffaf2a

Browse files
thorwhalenclaude
andcommitted
fix: Remove erroneous tomllib import in TOML test (fails on Python 3.10)
The decoder-only branch doesn't need to import tomllib directly — it tests via decode_by_extension which uses whatever decoder was registered (tomllib on 3.11+, tomli on older versions). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6c0f869 commit 9ffaf2a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

config2py/tests/test_codecs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ def test_toml_if_available(self):
342342
decoded = codecs.decode_by_extension('config.toml', encoded)
343343
assert decoded == data
344344
elif has_decoder:
345-
# tomllib/tomli available for reading but no tomli_w for writing
346-
import tomllib
345+
# tomllib (3.11+) or tomli available for reading, but no tomli_w for writing
347346
toml_bytes = b'[table]\nkey = "value"\nnumber = 42\n'
348347
decoded = codecs.decode_by_extension('config.toml', toml_bytes)
349348
assert decoded == data

0 commit comments

Comments
 (0)