Skip to content

Commit

Permalink
Prevent SyntaxWarning: invalid escape sequence '\s' errors on Pytho…
Browse files Browse the repository at this point in the history
…n 3.12+
  • Loading branch information
r-lyeh committed Jun 8, 2024
1 parent 1af3008 commit ff0d323
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/ZXDB_to_SQLite.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
line =')'

# SQLite doesn't like unsigned, so manually convert to an integer
line = re.sub('int\s*\(\d+\)\s+unsigned','INTEGER',line, flags=re.I)
line = re.sub(r'int\s*\(\d+\)\s+unsigned','INTEGER',line, flags=re.I)

# strip out indexes
if re.match('\s*KEY',line,re.I):
if re.match(r'\s*KEY',line,re.I):
line = ''

# fix unique constraint syntax and remove names
line = re.sub('\s*UNIQUE KEY \w*\s*\(','UNIQUE (',line)
line = re.sub(r'\s*UNIQUE KEY \w*\s*\(','UNIQUE (',line)

outFile.write(line)

Expand Down

0 comments on commit ff0d323

Please sign in to comment.