Replace deprecated distutils usage (removed in Python 3.12)#2550
Open
abhishek-8081 wants to merge 1 commit intocryptoadvance:masterfrom
Open
Replace deprecated distutils usage (removed in Python 3.12)#2550abhishek-8081 wants to merge 1 commit intocryptoadvance:masterfrom
abhishek-8081 wants to merge 1 commit intocryptoadvance:masterfrom
Conversation
- server.py: removed unused 'from distutils.core import setup' import - util/common.py: replaced distutils.util.strtobool with an inline implementation in str2bool() that has the same behavior Fixes cryptoadvance#2549
✅ Deploy Preview for specter-desktop-docs canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2549
distutilswas deprecated in Python 3.10 and fully removed in Python 3.12. This PR removes both usages from the codebase:Changes
server.py: Removedfrom distutils.core import setup— this import was not used anywhere in the file.util/common.py: Replacedfrom distutils.util import strtoboolwith an inline implementation inside the existingstr2bool()function. The behavior is exactly the same — it accepts the same true values (y, yes, t, true, on, 1) and false values (n, no, f, false, off, 0) and raisesValueErrorfor anything else.Without this fix, Specter will crash on startup with
ModuleNotFoundError: No module named 'distutils'if run on Python 3.12+.