File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -800,6 +800,7 @@ def cpu_signal_handler(
800800 @staticmethod
801801 def output_profile (program_args : Optional [List [str ]] = None ) -> bool :
802802 """Output the profile. Returns true iff there was any info reported the profile."""
803+ did_output : bool = False
803804 if Scalene .__args .json :
804805 json_output = Scalene .__json .output_profiles (
805806 Scalene .__program_being_profiled ,
@@ -837,9 +838,9 @@ def output_profile(program_args: Optional[List[str]] = None) -> bool:
837838 f .write (
838839 json .dumps (json_output , sort_keys = True , indent = 4 ) + "\n "
839840 )
840- return json_output != {}
841+ did_output = json_output != {}
841842
842- else :
843+ if Scalene . __args . cli :
843844 output = Scalene .__output
844845 column_width = Scalene .__args .column_width
845846 if not Scalene .__args .html :
@@ -863,7 +864,7 @@ def output_profile(program_args: Optional[List[str]] = None) -> bool:
863864 profile_memory = Scalene .__args .memory ,
864865 reduced_profile = Scalene .__args .reduced_profile ,
865866 )
866- return did_output
867+ return did_output
867868
868869 @staticmethod
869870 @functools .lru_cache (None )
You can’t perform that action at this time.
0 commit comments