Ports: Remove Python setlocale patch that's no longer needed

Since 4cd45f5, setlocale() always pretends to succeed.
This commit is contained in:
Linus Groh 2021-07-09 20:14:08 +01:00
parent e4124d0218
commit 2c78fa066f
Notes: sideshowbarker 2024-07-18 09:58:16 +09:00
2 changed files with 0 additions and 34 deletions

View file

@ -12,10 +12,6 @@ Enforce UTF-8 as encoding by defining `_Py_FORCE_UTF8_LOCALE`.
As usual, make the `configure` script recognize Serenity. Also set `MACHDEP` (which is used for `sys.platform`) to a version-less `serenityos`, even when not cross-compiling.
## `remove-setlocale-from-preconfig.patch`
Our stub implementation of `setlocale()` always returns `nullptr`, which the interpreter considers critical enough to exit right away.
## `webbrowser.patch`
Register the SerenityOS Browser in the [`webbrowser`](https://docs.python.org/3/library/webbrowser.html) module.

View file

@ -1,30 +0,0 @@
--- Python-3.9.6/Python/preconfig.c 2021-02-21 20:22:44.076023521 +0100
+++ Python-3.9.6/Python/preconfig.c 2021-02-21 20:36:10.936698893 +0100
@@ -790,16 +790,6 @@
preconfig_get_global_vars(config);
- /* Copy LC_CTYPE locale, since it's modified later */
- const char *loc = setlocale(LC_CTYPE, NULL);
- if (loc == NULL) {
- return _PyStatus_ERR("failed to LC_CTYPE locale");
- }
- char *init_ctype_locale = _PyMem_RawStrdup(loc);
- if (init_ctype_locale == NULL) {
- return _PyStatus_NO_MEMORY();
- }
-
/* Save the config to be able to restore it if encodings change */
PyPreConfig save_config;
@@ -899,10 +889,6 @@
status = _PyStatus_OK();
done:
- if (init_ctype_locale != NULL) {
- setlocale(LC_CTYPE, init_ctype_locale);
- PyMem_RawFree(init_ctype_locale);
- }
Py_UTF8Mode = init_utf8_mode ;
#ifdef MS_WINDOWS
Py_LegacyWindowsFSEncodingFlag = init_legacy_encoding;