# HG changeset patch # User gyorgyf # Date 1380976587 -3600 # Node ID 577b251cad2f528d87fca1dd0abdc221e90448d7 # Parent 74703a562ce3cb0fa00837c8330e3cc7f66a3677 applied patch to fix bug related to numpy version string parsing diff -r 74703a562ce3 -r 577b251cad2f vampy-main.cpp --- a/vampy-main.cpp Sat Oct 05 13:21:47 2013 +0100 +++ b/vampy-main.cpp Sat Oct 05 13:36:27 2013 +0100 @@ -39,7 +39,7 @@ #include "PyPlugin.h" #include "PyExtensionModule.h" #include "PyExtensionManager.h" - +#include #ifdef _WIN32 #define pathsep ('\\') @@ -115,6 +115,7 @@ #ifdef HAVE_NUMPY string ver; + std::istringstream verStream; float numpyVersion; /// attmept to test numpy version before importing the array API @@ -146,11 +147,16 @@ ver = PyString_AsString(pyVer); ver = ver.substr(0,ver.rfind(".")); - if(EOF == sscanf(ver.c_str(), "%f", &numpyVersion)) - { - cerr << "Could not parse Numpy version information." << endl; - goto numpyFailure; - } + /* + Applied patch from here: http://vamp-plugins.org/forum/index.php/topic,162.msg387.html#msg387 to replace this: + if(EOF == sscanf(ver.c_str(), "%f", &numpyVersion)) + { + cerr << "Could not parse Numpy version information." << endl; + goto numpyFailure; + }*/ + // parse version string to float + verStream.str(ver); + verStream >> numpyVersion; cerr << "Numpy runtime version: " << numpyVersion << endl; if (numpyVersion < (float) NUMPY_SHORTVERSION) {