Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a95775e

Browse files
authored
Merge pull request #24943 from oscargus/pypyspecialcaseremoval
Remove special casing for PyPy not required anymore
2 parents 21663b5 + be1f0c2 commit a95775e

File tree

4 files changed

+0
-41
lines changed

4 files changed

+0
-41
lines changed

src/_c_internal_utils.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ mpl_GetCurrentProcessExplicitAppUserModelID(PyObject* module)
6868
wchar_t* appid = NULL;
6969
HRESULT hr = GetCurrentProcessExplicitAppUserModelID(&appid);
7070
if (FAILED(hr)) {
71-
#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x07030600
72-
/* Remove when we require PyPy 7.3.6 */
73-
PyErr_SetFromWindowsErr(hr);
74-
return NULL;
75-
#else
7671
return PyErr_SetFromWindowsErr(hr);
77-
#endif
7872
}
7973
PyObject* py_appid = PyUnicode_FromWideChar(appid, -1);
8074
CoTaskMemFree(appid);
@@ -95,13 +89,7 @@ mpl_SetCurrentProcessExplicitAppUserModelID(PyObject* module, PyObject* arg)
9589
HRESULT hr = SetCurrentProcessExplicitAppUserModelID(appid);
9690
PyMem_Free(appid);
9791
if (FAILED(hr)) {
98-
#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x07030600
99-
/* Remove when we require PyPy 7.3.6 */
100-
PyErr_SetFromWindowsErr(hr);
101-
return NULL;
102-
#else
10392
return PyErr_SetFromWindowsErr(hr);
104-
#endif
10593
}
10694
Py_RETURN_NONE;
10795
#else

src/_macosx.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,7 @@ static void lazy_init(void) {
285285
NSApp = [NSApplication sharedApplication];
286286
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
287287

288-
#ifndef PYPY
289-
/* TODO: remove ifndef after the new PyPy with the PyOS_InputHook implementation
290-
get released: https://bitbucket.org/pypy/pypy/commits/caaf91a */
291288
PyOS_InputHook = wait_for_stdin;
292-
#endif
293289

294290
WindowServerConnectionManager* connectionManager = [WindowServerConnectionManager sharedManager];
295291
NSWorkspace* workspace = [NSWorkspace sharedWorkspace];

src/_path.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
#include "_backend_agg_basic_types.h"
2222
#include "numpy_cpp.h"
2323

24-
/* Compatibility for PyPy3.7 before 7.3.4. */
25-
#ifndef Py_DTSF_ADD_DOT_0
26-
#define Py_DTSF_ADD_DOT_0 0x2
27-
#endif
28-
2924
struct XY
3025
{
3126
double x;

src/ft2font_wrapper.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,9 @@ static PyObject *PyFT2Font_get_fontmap(PyFT2Font *self, PyObject *args, PyObject
575575

576576
if (PyUnicode_Check(textobj)) {
577577
size = PyUnicode_GET_LENGTH(textobj);
578-
#if defined(PYPY_VERSION) && (PYPY_VERSION_NUM < 0x07040000)
579-
// PyUnicode_ReadChar is available from PyPy 7.3.2, but wheels do not
580-
// specify the micro-release version, so put the version bound at 7.4
581-
// to prevent generating wheels unusable on PyPy 7.3.{0,1}.
582-
Py_UNICODE *unistr = PyUnicode_AsUnicode(textobj);
583-
for (size_t i = 0; i < size; ++i) {
584-
codepoints.insert(unistr[i]);
585-
}
586-
#else
587578
for (size_t i = 0; i < size; ++i) {
588579
codepoints.insert(PyUnicode_ReadChar(textobj, i));
589580
}
590-
#endif
591581
} else {
592582
PyErr_SetString(PyExc_TypeError, "string must be str");
593583
return NULL;
@@ -656,19 +646,9 @@ static PyObject *PyFT2Font_set_text(PyFT2Font *self, PyObject *args, PyObject *k
656646
if (PyUnicode_Check(textobj)) {
657647
size = PyUnicode_GET_LENGTH(textobj);
658648
codepoints.resize(size);
659-
#if defined(PYPY_VERSION) && (PYPY_VERSION_NUM < 0x07040000)
660-
// PyUnicode_ReadChar is available from PyPy 7.3.2, but wheels do not
661-
// specify the micro-release version, so put the version bound at 7.4
662-
// to prevent generating wheels unusable on PyPy 7.3.{0,1}.
663-
Py_UNICODE *unistr = PyUnicode_AsUnicode(textobj);
664-
for (size_t i = 0; i < size; ++i) {
665-
codepoints[i] = unistr[i];
666-
}
667-
#else
668649
for (size_t i = 0; i < size; ++i) {
669650
codepoints[i] = PyUnicode_ReadChar(textobj, i);
670651
}
671-
#endif
672652
} else {
673653
PyErr_SetString(PyExc_TypeError, "set_text requires str-input.");
674654
return NULL;

0 commit comments

Comments
 (0)