Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 921d4f4

Browse filesBrowse files
authored
Merge pull request #12629 from Mottl/pypy-inputhook
Fix issue with PyPy on macOS
2 parents e4ba4f2 + 4b5096e commit 921d4f4
Copy full SHA for 921d4f4

File tree

Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed

‎setupext.py

Copy file name to clipboardExpand all lines: setupext.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,8 @@ def get_extension(self):
12701270

12711271
ext = make_extension('matplotlib.backends._macosx', sources)
12721272
ext.extra_link_args.extend(['-framework', 'Cocoa'])
1273+
if platform.python_implementation().lower() == 'pypy':
1274+
ext.extra_compile_args.append('-DPYPY=1')
12731275
return ext
12741276

12751277

‎src/_macosx.m

Copy file name to clipboardExpand all lines: src/_macosx.m
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
#include <sys/socket.h>
44
#include <Python.h>
55

6+
#ifndef PYPY
67
/* Remove this once Python is fixed: https://bugs.python.org/issue23237 */
78
#define PYOSINPUTHOOK_REPETITIVE 1
9+
#endif
810

911
/* Proper way to check for the OS X version we are compiling for, from
1012
http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development */
@@ -277,7 +279,9 @@ static void lazy_init(void) {
277279

278280
NSApp = [NSApplication sharedApplication];
279281

282+
#ifndef PYPY
280283
PyOS_InputHook = wait_for_stdin;
284+
#endif
281285

282286
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
283287
WindowServerConnectionManager* connectionManager = [WindowServerConnectionManager sharedManager];

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.