B 1szrun_command..)stdoutstderrNr zCommand "{0}" failed withrz------z{1}rz{2}) isinstancer listosnamer r Z communicateZpollZ terminate returncode RuntimeErrorrr)cmdZ check_codeprocrrrrr run_commands   r#c Cstjdkr^ttj}|dr(d|}nd|}ttj|dg\}}}|dk}t|dntj}t |j }t |j }dd|d|d |f} d }xD| D]<}y*t|dg\}}}t |dd }PWqYqXqWd | } t|| dS) NZwin32ZScriptsz %s\f2py.pyz%s\Scripts\f2py.pyz-v2zWarning: f2py not found in pathZf2py.FTz/Warning: neither %s nor %s nor %s found in path) sysplatformr executableendswithr#stripr version_infostrmajorminorr ) exe_dirZf2py_cmdcoderrsuccessversionr-r.Z f2py_cmdsmsgrrr test_f2py>s.          r4)T)__doc__Z __future__rrrrZos.pathrZpathjoinrrrr& subprocessr r ZnumpyZnpZnumpy.compat.py3kr Z nose.toolsr Znumpy.testing.decoratorsr Z numpy.testingr__file__Z is_inplacer#r4rrrrs     *