35
35
36
36
37
37
def get_toplevel ():
38
- return check_output (["git" , "rev-parse" , "--show-toplevel" ], universal_newlines = True , encoding = "utf8" ).rstrip ("\n " )
38
+ return check_output (["git" , "rev-parse" , "--show-toplevel" ], text = True , encoding = "utf8" ).rstrip ("\n " )
39
39
40
40
41
41
def list_files_by_suffix (suffixes ):
42
42
exclude_args = [":(exclude)" + dir for dir in EXCLUDED_DIRS ]
43
43
44
- files_list = check_output (["git" , "ls-files" , "src" ] + exclude_args , universal_newlines = True , encoding = "utf8" ).splitlines ()
44
+ files_list = check_output (["git" , "ls-files" , "src" ] + exclude_args , text = True , encoding = "utf8" ).splitlines ()
45
45
46
46
return [file for file in files_list if file .endswith (suffixes )]
47
47
@@ -63,7 +63,7 @@ def find_included_cpps():
63
63
included_cpps = list ()
64
64
65
65
try :
66
- included_cpps = check_output (["git" , "grep" , "-E" , r"^#include [<\"][^>\"]+\.cpp[>\"]" , "--" , "*.cpp" , "*.h" ], universal_newlines = True , encoding = "utf8" ).splitlines ()
66
+ included_cpps = check_output (["git" , "grep" , "-E" , r"^#include [<\"][^>\"]+\.cpp[>\"]" , "--" , "*.cpp" , "*.h" ], text = True , encoding = "utf8" ).splitlines ()
67
67
except CalledProcessError as e :
68
68
if e .returncode > 1 :
69
69
raise e
@@ -77,7 +77,7 @@ def find_extra_boosts():
77
77
exclusion_set = set ()
78
78
79
79
try :
80
- included_boosts = check_output (["git" , "grep" , "-E" , r"^#include <boost/" , "--" , "*.cpp" , "*.h" ], universal_newlines = True , encoding = "utf8" ).splitlines ()
80
+ included_boosts = check_output (["git" , "grep" , "-E" , r"^#include <boost/" , "--" , "*.cpp" , "*.h" ], text = True , encoding = "utf8" ).splitlines ()
81
81
except CalledProcessError as e :
82
82
if e .returncode > 1 :
83
83
raise e
@@ -100,7 +100,7 @@ def find_quote_syntax_inclusions():
100
100
quote_syntax_inclusions = list ()
101
101
102
102
try :
103
- quote_syntax_inclusions = check_output (["git" , "grep" , r"^#include \"" , "--" , "*.cpp" , "*.h" ] + exclude_args , universal_newlines = True , encoding = "utf8" ).splitlines ()
103
+ quote_syntax_inclusions = check_output (["git" , "grep" , r"^#include \"" , "--" , "*.cpp" , "*.h" ] + exclude_args , text = True , encoding = "utf8" ).splitlines ()
104
104
except CalledProcessError as e :
105
105
if e .returncode > 1 :
106
106
raise e
@@ -143,13 +143,13 @@ def main():
143
143
if extra_boosts :
144
144
for boost in extra_boosts :
145
145
print (f"A new Boost dependency in the form of \" { boost } \" appears to have been introduced:" )
146
- print (check_output (["git" , "grep" , boost , "--" , "*.cpp" , "*.h" ], universal_newlines = True , encoding = "utf8" ))
146
+ print (check_output (["git" , "grep" , boost , "--" , "*.cpp" , "*.h" ], text = True , encoding = "utf8" ))
147
147
exit_code = 1
148
148
149
149
# Check if Boost dependencies are no longer used
150
150
for expected_boost in EXPECTED_BOOST_INCLUDES :
151
151
try :
152
- check_output (["git" , "grep" , "-q" , r"^#include <%s>" % expected_boost , "--" , "*.cpp" , "*.h" ], universal_newlines = True , encoding = "utf8" )
152
+ check_output (["git" , "grep" , "-q" , r"^#include <%s>" % expected_boost , "--" , "*.cpp" , "*.h" ], text = True , encoding = "utf8" )
153
153
except CalledProcessError as e :
154
154
if e .returncode > 1 :
155
155
raise e
0 commit comments