Author: tlinnet Date: Fri Sep 5 11:09:49 2014 New Revision: 25664 URL: http://svn.gna.org/viewcvs/relax?rev=25664&view=rev Log: Fix for raising error when calling showApod, and subprocess module not available. Modified: trunk/lib/spectrum/nmrpipe.py Modified: trunk/lib/spectrum/nmrpipe.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/spectrum/nmrpipe.py?rev=25664&r1=25663&r2=25664&view=diff ============================================================================== --- trunk/lib/spectrum/nmrpipe.py (original) +++ trunk/lib/spectrum/nmrpipe.py Fri Sep 5 11:09:49 2014 @@ -212,20 +212,19 @@ # Get the file path. file_path = get_file_path(file_name=file_name, dir=dir) - if dep_check.subprocess_module: - # Call function. - Temp=subprocess.Popen([path_to_command, file_path], stdout=subprocess.PIPE) - - # Communicate with program, and get outout and exitcode. - (output, errput) = Temp.communicate() - - # Wait for finish and get return code. - return_value = Temp.wait() - - return output.splitlines() - - else: - raise RelaxError("python module 'subprocess' not found. Cannot call showApod.") + if not dep_check.subprocess_module: + raise RelaxError("Python module 'subprocess' not found, cannot call showApod.") + + # Call function. + Temp = subprocess.Popen([path_to_command, file_path], stdout=subprocess.PIPE) + + # Communicate with program, and get outout and exitcode. + (output, errput) = Temp.communicate() + + # Wait for finish and get return code. + return_value = Temp.wait() + + return output.splitlines() def show_apod_rmsd(file_name=None, dir=None, path_to_command='showApod'):