@@ -858,7 +858,7 @@ def _outputs_help(cls):
858
858
""" Prints description for output parameters
859
859
"""
860
860
helpstr = ['Outputs::' , '' ]
861
- if cls .output_spec :
861
+ if cls .output_spec is not None :
862
862
outputs = cls .output_spec ()
863
863
for name , spec in sorted (outputs .traits (transient = None ).items ()):
864
864
helpstr += cls ._get_trait_desc (outputs , name , spec )
@@ -870,7 +870,7 @@ def _outputs(self):
870
870
""" Returns a bunch containing output fields for the class
871
871
"""
872
872
outputs = None
873
- if self .output_spec :
873
+ if self .output_spec is not None :
874
874
outputs = self .output_spec ()
875
875
return outputs
876
876
@@ -1091,7 +1091,7 @@ def run(self, **inputs):
1091
1091
def _list_outputs (self ):
1092
1092
""" List the expected outputs
1093
1093
"""
1094
- if self .output_spec :
1094
+ if self .output_spec is not None :
1095
1095
raise NotImplementedError
1096
1096
else :
1097
1097
return None
@@ -1450,8 +1450,8 @@ def _get_environ(self):
1450
1450
1451
1451
def version_from_command (self , flag = '-v' ):
1452
1452
cmdname = self .cmd .split ()[0 ]
1453
- if _exists_in_path ( cmdname ):
1454
- env = dict ( os . environ )
1453
+ env = dict ( os . environ )
1454
+ if _exists_in_path ( cmdname , env ):
1455
1455
out_environ = self ._get_environ ()
1456
1456
env .update (out_environ )
1457
1457
proc = subprocess .Popen (' ' .join ((cmdname , flag )),
@@ -1612,7 +1612,7 @@ def _overload_extension(self, value, name=None):
1612
1612
def _list_outputs (self ):
1613
1613
metadata = dict (name_source = lambda t : t is not None )
1614
1614
traits = self .inputs .traits (** metadata )
1615
- if traits :
1615
+ if traits and self . output_spec is not None :
1616
1616
outputs = self .output_spec ().get ()
1617
1617
for name , trait_spec in traits .items ():
1618
1618
out_name = name
0 commit comments