Skip to content

Commit fb7f22a

Browse files
authored
Merge pull request #510 from GambitBSM/python_string_fix
Python 3.12 requires raw strings in some cases
2 parents cd043b7 + 5fc17b1 commit fb7f22a

8 files changed

Lines changed: 58 additions & 58 deletions

File tree

Backends/scripts/backend_harvester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def main(argv):
106106
print(' gambit/Backends/backend_types/'+h)
107107

108108
# Generate a c++ header containing all the frontend headers we have just harvested.
109-
towrite = "\
109+
towrite = r"\
110110
// GAMBIT: Global and Modular BSM Inference Tool\n\
111111
// *********************************************\n\
112112
/// \\file \n\
@@ -148,7 +148,7 @@ def main(argv):
148148
f.write(towrite)
149149

150150
# Generate a c++ header containing all the frontend headers we have just harvested.
151-
towrite = "\
151+
towrite = r"\
152152
// GAMBIT: Global and Modular BSM Inference Tool\n\
153153
// *********************************************\n\
154154
/// \\file \n\

ColliderBit/scripts/collider_harvester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def main(argv):
5555
print(' gambit/ColliderBit/models/'+h)
5656

5757
# Generate a C++ header containing all the model headers we have just harvested.
58-
towrite = "\
58+
towrite = r"\
5959
// GAMBIT: Global and Modular BSM Inference Tool\n\
6060
// *********************************************\n\
6161
/// \\file \n\
@@ -82,7 +82,7 @@ def main(argv):
8282
f.write(towrite)
8383

8484
# Generate a C++ header containing Py8Collider typedefs for all the model headers we have just harvested.
85-
towrite = "\
85+
towrite = r"\
8686
// GAMBIT: Global and Modular BSM Inference Tool\n\
8787
// *********************************************\n\
8888
/// \\file \n\

Elements/scripts/module_harvester.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ def main(argv):
120120
if verbose: print("Module rollcall headers identified:")
121121
for h in module_rollcall_headers:
122122
if verbose: print(' ',h)
123-
h_parts = neatsplit('\/',h)
123+
h_parts = neatsplit(r'\/',h)
124124
modules.add(h_parts[1])
125125
for h in retrieve_rollcall_headers(verbose,".",exclude_header, retrieve_excluded=True):
126-
h_parts = neatsplit('\/',h)
126+
h_parts = neatsplit(r'\/',h)
127127
modules_excluded.add(h_parts[1])
128128
if verbose:
129129
print("Module type headers identified:")
@@ -132,7 +132,7 @@ def main(argv):
132132

133133

134134
# Generate a c++ header containing all the module type headers we have just harvested.
135-
towrite = "\
135+
towrite = r"\
136136
// GAMBIT: Global and Modular BSM Inference Tool\n\
137137
// *********************************************\n\
138138
/// \\file \n\
@@ -254,7 +254,7 @@ def main(argv):
254254
if t != "": print(' ',t)
255255

256256
# Generate a c++ header containing the backend functor template specialisations, using all the backend types we have harvested.
257-
towrite = "\
257+
towrite = r"\
258258
// GAMBIT: Global and Modular BSM Inference Tool\n\
259259
// *********************************************\n\
260260
/// \\file \n\
@@ -301,7 +301,7 @@ def main(argv):
301301

302302

303303
# Generate a c++ source file containing the module functor template specialisations, using all the module types we have harvested.
304-
towrite = "\
304+
towrite = r"\
305305
// GAMBIT: Global and Modular BSM Inference Tool\n\
306306
// *********************************************\n\
307307
/// \\file \n\

Models/scripts/model_harvester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def main(argv):
6262
print(' gambit/Models/model_types/'+h)
6363

6464
# Generate a c++ header containing all the model headers we have just harvested.
65-
towrite = "\
65+
towrite = r"\
6666
// GAMBIT: Global and Modular BSM Inference Tool\n\
6767
// *********************************************\n\
6868
/// \\file \n\
@@ -103,7 +103,7 @@ def main(argv):
103103
f.write(towrite)
104104

105105
# Generate a c++ header containing all the model type headers we have just harvested.
106-
towrite = "\
106+
towrite = r"\
107107
// GAMBIT: Global and Modular BSM Inference Tool\n\
108108
// *********************************************\n\
109109
/// \\file \n\

Models/scripts/particle_harvester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def main(argv):
116116
BSM_sets = data['OtherModels']['Sets'] # add_particle_set
117117
Generic = data['OtherModels']['Generic'] # add_generic_particle
118118

119-
towrite = "\
119+
towrite = r"\
120120
// GAMBIT: Global and Modular BSM Inference Tool\n\
121121
// *********************************************\n\
122122
/// \\file \n\

Printers/scripts/printer_harvester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def main(argv):
5959
printer_headers.update(retrieve_generic_headers(verbose,"./Printers/include/gambit/Printers/printers","printer",exclude_printers))
6060

6161
# Generate a c++ header containing all the printer headers we have just harvested.
62-
towrite = "\
62+
towrite = r"\
6363
// GAMBIT: Global and Modular BSM Inference Tool\n\
6464
// *********************************************\n\
6565
/// \\file \n\

ScannerBit/scripts/scanner+_harvester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def main(argv):
409409
if type(f) is dict:
410410
for key, value in f.items():
411411
if key in ("lib", "libs", "library", "libraries", "library_path", "library_paths", "-lib", "-libs", "-library", "-libraries", "-library_path", "-library_paths"):
412-
libs = neatsplit(',|\s|;', value)
412+
libs = neatsplit(r',|\s|;', value)
413413
for lib in libs:
414414
if os.path.isfile(lib):
415415
lib_full = os.path.abspath(lib)
@@ -445,7 +445,7 @@ def main(argv):
445445
scanbit_reqs[plugin[7]][plugin_name][version][4] += [lib]
446446

447447
elif key in ("inc", "incs", "include", "includes", "include_path", "include_paths", "-inc", "-incs", "-include", "-includes", "-include_path", "-include_paths", "hdr", "hdrs", "header", "headers", "-hdr", "-hdrs", "-header", "-headers"):
448-
incs = neatsplit(',|\s|;', value)
448+
incs = neatsplit(r',|\s|;', value)
449449
for inc in incs:
450450
if os.path.isdir(inc):
451451
inc = os.path.abspath(inc)

0 commit comments

Comments
 (0)