overthesun / simoc-sam

Live backend for SAM at Biosphere 2
2 stars 1 forks source link

Use raw strings for regex patterns in simoc-sam.py. #116

Closed ezio-melotti closed 2 months ago

ezio-melotti commented 2 months ago

This solves a few Python 3.12 warnings:

simoc-sam/simoc-sam.py:98: SyntaxWarning: invalid escape sequence '\d'
  ipv4_re = re.compile('^\d+\.\d+\.\d+\.\d+$')  # does it look like an IPv4?
simoc-sam/simoc-sam.py:139: SyntaxWarning: invalid escape sequence '\d'
  host_re = re.compile('^samrpi(\d+)$')
simoc-sam/simoc-sam.py:140: SyntaxWarning: invalid escape sequence '\s'
  address_re = re.compile('^(\s*address\s+)((\d+\.\d+.\d+.)(\d+))(\s*)$')