8000 Matplotlib requires Python 3.6, which in turn requires Mac OS X 10.6+ · matplotlib/matplotlib@6df2e0f · GitHub
[go: up one dir, main page]

Skip to content

Commit 6df2e0f

Browse files
committed
Matplotlib requires Python 3.6, which in turn requires Mac OS X 10.6+
1 parent 71a785d commit 6df2e0f

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

src/_macosx.m

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
/* Proper way to check for the OS X version we are compiling for, from
1313
http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development */
14-
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
15-
#define COMPILING_FOR_10_6
16-
#endif
1714
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
1815
#define COMPILING_FOR_10_7
1916
#endif
@@ -204,11 +201,7 @@ - (void)masterCloses:(NSNotification*)notification;
204201
- (void)close;
205202
@end
206203

207-
#ifdef COMPILING_FOR_10_6
208204
@interface View : NSView <NSWindowDelegate>
209-
#else
210-
@interface View : NSView
211-
#endif
212205
{ PyObject* canvas;
213206
NSRect rubberband;
214207
BOOL inside;
@@ -1379,29 +1372,21 @@ -(void)save_figure:(id)sender
13791372
[[NSString alloc]
13801373
initWithCString: default_filename
13811374
encoding: NSUTF8StringEncoding];
1382-
#ifdef COMPILING_FOR_10_6
13831375
[panel setNameFieldStringValue: ns_default_filename];
13841376
result = [panel runModal];
1385-
#else
1386-
result = [panel runModalForDirectory: nil file: ns_default_filename];
1387-
#endif
13881377
[ns_default_filename release];
13891378
#ifdef COMPILING_FOR_10_10
13901379
if (result == NSModalResponseOK)
13911380
#else
13921381
if (result == NSOKButton)
13931382
#endif
13941383
{
1395-
#ifdef COMPILING_FOR_10_6
13961384
NSURL* url = [panel URL];
13971385
NSString* filename = [url path];
13981386
if (!filename) {
13991387
PyErr_SetString(PyExc_RuntimeError, "Failed to obtain filename");
14001388
return 0;
14011389
}
1402-
#else
1403-
NSString* filename = [panel filename];
1404-
#endif
14051390
unsigned int n = [filename length];
14061391
unichar* buffer = malloc(n*sizeof(unichar));
14071392
[filename getCharacters: buffer];
@@ -2581,26 +2566,6 @@ static void context_cleanup(const void* info)
25812566
Timer_new, /* tp_new */
25822567
};
25832568

2584-
#ifndef COMPILING_FOR_10_6
2585-
static bool verify_framework(void)
2586-
{
2587-
ProcessSerialNumber psn;
2588-
if (CGMainDisplayID()!=0
2589-
&& GetCurrentProcess(&psn)==noErr
2590-
&& SetFrontProcess(&psn)==noErr) return true;
2591-
PyErr_SetString(PyExc_ImportError,
2592-
"Python is not installed as a framework. The Mac OS X backend will "
2593-
"not be able to function correctly if Python is not installed as a "
2594-
"framework. See the Python documentation for more information on "
2595-
"installing Python as a framework on Mac OS X. Please either reinstall "
2596-
"Python as a framework, or try one of the other backends. If you are "
2597-
"using (Ana)Conda please install python.app and replace the use of "
2598-
"'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the "
2599-
"Matplotlib FAQ for more information.");
2600-
return false;
2601-
}
2602-
#endif
2603-
26042569
static struct PyMethodDef methods[] = {
26052570
{"event_loop_is_running",
26062571
(PyCFunction)event_loop_is_running,
@@ -2650,12 +2615,6 @@ static bool verify_framework(void)
26502615
|| PyType_Ready(&TimerType) < 0)
26512616
return NULL;
26522617

2653-
#ifndef COMPILING_FOR_10_6
2654-
/* if >=10.6 invoke setActivationPolicy in lazy_init */
2655-
if (!verify_framework())
2656-
return NULL;
2657-
#endif
2658-
26592618
module = PyModule_Create(&moduledef);
26602619
if (!module)
26612620
return NULL;

0 commit comments

Comments
 (0)
0