Skip to content

Commit

Permalink
fix parsing with inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gmjosack committed Dec 18, 2021
1 parent c2ef8bd commit e727908
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modlunky2/ui/play/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class PlaylunkyConfig:

@classmethod
def from_ini(cls, handle: TextIO) -> "PlaylunkyConfig":
config = configparser.ConfigParser()
config = configparser.ConfigParser(inline_comment_prefixes="#")
config.read_file(handle)

obj = cls()
Expand Down
4 changes: 2 additions & 2 deletions src/tests/playlunky/ini_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ def test_legacy_keep_unknown():
random_character_select=off
enable_loose_audio_files=on
some_unknown_field=ABACAB00
cache_decoded_audio_files=off
cache_decoded_audio_files=off # test inline-comment
enable_developer_mode=off
[script_settings]
enable_developer_console=on
console_history_size=50
console_history_size=50 # test inline-comment
"""
)
)
Expand Down

0 comments on commit e727908

Please sign in to comment.