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

Skip to content

Commit abbd115

Browse files
committed
Fix issue with PyPy on macOS
1 parent cfc01ce commit abbd115

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

setupext.py

Lines 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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ static void lazy_init(void) {
277277

278278
NSApp = [NSApplication sharedApplication];
279279

280+
#ifndef PYPY
280281
PyOS_InputHook = wait_for_stdin;
282+
#endif
281283

282284
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
283285
WindowServerConnectionManager* connectionManager = [WindowServerConnectionManager sharedManager];

0 commit comments

Comments
 (0)