Skip to content

Commit

Permalink
python 3.12 warning fix & minor cleanup
Browse files Browse the repository at this point in the history
fixes these warnings:
.../build/ramdisk.py:115: SyntaxWarning: invalid escape sequence '\.'
  c_filename = re.sub("\.", "_", c_filename)
.../build/ramdisk.py:156: SyntaxWarning: invalid escape sequence '\.'
  c_filename = re.sub("\.", "_", c_filename)
  • Loading branch information
hirdrac committed Nov 29, 2023
1 parent a782e7f commit 607e9c4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions build/ramdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@
count += 1

rec, orig_filename = filename
c_filename = orig_filename
c_filename = re.sub("-", "_", c_filename)
c_filename = re.sub("\.", "_", c_filename)
c_filename = re.sub(r'[\-\.]', "_", orig_filename)
rel_path_filename = os.path.join(folder, orig_filename)

with open("src/ramdisk_data_{}.S".format(ram_file), "a") as myfile:
Expand Down Expand Up @@ -151,9 +149,7 @@
count += 1

rec, orig_filename = filename
c_filename = orig_filename
c_filename = re.sub("-", "_", c_filename)
c_filename = re.sub("\.", "_", c_filename)
c_filename = re.sub(r'[\-\.]', "_", orig_filename)
rel_path_filename = os.path.join(folder, orig_filename)

myfile.write(" {\n")
Expand Down

0 comments on commit 607e9c4

Please sign in to comment.