@@ -476,7 +476,7 @@ class DumpASTMatchersHelper(FormatHelper):
476476
477477 @property
478478 def instructions (self ) -> str :
479- return f"cd { self .script_dir } && python { self .script_name } "
479+ return f"cd { self .script_dir } && python3 { self .script_name } "
480480
481481 def should_run (self , changed_files : List [str ]) -> List [str ]:
482482 for file in changed_files :
@@ -498,15 +498,15 @@ def format_run(self, changed_files: List[str], args: FormatArgs) -> Optional[str
498498
499499 # Run the 'dump_ast_matchers.py' from its directory as specified in the script doc
500500 proc = subprocess .run (
501- ["python " , self .script_name ],
501+ ["python3 " , self .script_name ],
502502 stdout = subprocess .PIPE ,
503503 stderr = subprocess .PIPE ,
504504 encoding = "utf-8" ,
505505 cwd = self .script_dir ,
506506 )
507507
508508 if proc .returncode != 0 :
509- return f"Execution of ' dump_ast_matchers.py' failed:\n { proc .stderr } \n { proc .stdout } "
509+ return f"dump_ast_matchers.py failed with code { proc . returncode } :\n { proc .stderr } \n { proc .stdout } "
510510
511511 # Check if 'LibASTMatchersReference.html' file was modified
512512 cmd = ["git" , "diff" , "--exit-code" , self .output_html ]
@@ -518,8 +518,8 @@ def format_run(self, changed_files: List[str], args: FormatArgs) -> Optional[str
518518 if proc .returncode != 0 :
519519 if args .verbose :
520520 print (f"error: { self .name } exited with code { proc .returncode } " )
521- print (proc .stdout . decode ( "utf-8" ) )
522- return proc .stdout . decode ( "utf-8" )
521+ print (proc .stdout )
522+ return proc .stdout
523523 else :
524524 return None
525525
0 commit comments