We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9b80eb commit b57b40dCopy full SHA for b57b40d
1 file changed
Common/Constants/include/CommonConstants/make_pdg_header.py
@@ -196,6 +196,7 @@ def main():
196
197
# Get header content before and after the generated block.
198
path_header = "PhysicsConstants.h"
199
+ print(f"File {path_header} will be updated.")
200
try:
201
with open(path_header, encoding="utf-8") as file:
202
content_old = file.readlines()
@@ -252,7 +253,15 @@ def main():
252
253
*lines_header_after,
254
)
255
- print(content_new)
256
+ # print(content_new)
257
+
258
+ try:
259
+ with open(path_header, "w", encoding="utf-8") as file:
260
+ file.write(content_new)
261
+ print(f"File {path_header} has been overwritten.")
262
+ except OSError:
263
+ print(f'Failed to write to file "{path_header}".')
264
+ sys.exit(1)
265
266
267
if __name__ == "__main__":
0 commit comments