Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

fix: replace removeprefix/removesuffix for Python 3.8 compatibility#1

Open
AmSach wants to merge 1 commit intomasterfrom
fix/python3-8-compatibility-removeprefix
Open

fix: replace removeprefix/removesuffix for Python 3.8 compatibility#1
AmSach wants to merge 1 commit intomasterfrom
fix/python3-8-compatibility-removeprefix

Conversation

@AmSach
Copy link
Copy Markdown
Owner

@AmSach AmSach commented Apr 30, 2026

Fixed the bug described in issue jorio#45.

What was wrong: The build.py script used str.removeprefix() and str.removesuffix() methods which were introduced in Python 3.9. When running on Python 3.8 (or earlier Python 3 versions), this causes AttributeError: 'str' object has no attribute 'removeprefix'.

How I fixed it: Replaced the chained value.removeprefix('"').removesuffix('"') call with a simple manual check using startswith() and endswith() with string slicing: if value.startswith('"') and value.endswith('"'): value = value[1:-1]

Tested by: The fix is a direct equivalent that works on Python 3.6+ (all currently supported Python versions per PEP 494). The syntax was verified to parse correctly.

Fixes jorio#45

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with building on Windows

1 participant