diff --git a/src/stimfit/gui/app.h b/src/stimfit/gui/app.h index c1285cf4..bfc2522c 100755 --- a/src/stimfit/gui/app.h +++ b/src/stimfit/gui/app.h @@ -201,11 +201,13 @@ enum { #if defined(__WXMAC__) || defined(__WXGTK__) #pragma GCC diagnostic ignored "-Wwrite-strings" #endif +#ifdef WITH_PYTHON #if PY_MAJOR_VERSION >= 3 #include #else #include #endif +#endif // revert to previous behaviour #if defined(__WXMAC__) || defined(__WXGTK__) #pragma GCC diagnostic warning "-Wwrite-strings" diff --git a/src/stimfit/gui/doc.cpp b/src/stimfit/gui/doc.cpp index b5305724..ded01b3f 100755 --- a/src/stimfit/gui/doc.cpp +++ b/src/stimfit/gui/doc.cpp @@ -45,7 +45,10 @@ #include "./../../libstfnum/funclib.h" #include "./../../libstfnum/measure.h" #include "./../../libstfio/stfio.h" +#ifdef WITH_PYTHON #include "./../../pystfio/pystfio.h" +#endif + #include "./usrdlg/usrdlg.h" #include "./doc.h" #include "./graph.h" @@ -231,8 +234,13 @@ bool wxStfDoc::OnOpenDocument(const wxString& filename) { } #endif if (type == stfio::tdms) { +#ifdef WITH_PYTHON if (!LoadTDMS(stf::wx2std(filename), *this)) { wxString errorMsg(wxT("Error opening file\n")); +#else + { + wxString errorMsg(wxT("Error opening file - TDMS requires python \n")); +#endif wxGetApp().ExceptMsg(errorMsg); get().clear(); return false;