py-models-parser
py-models-parser copied to clipboard
Fix invalid escape sequence messages
When running
from omymodels.models.pydantic import types
under Python 3.12 I get
<unknown>:1: SyntaxWarning: invalid escape sequence '\#'
<unknown>:1: SyntaxWarning: invalid escape sequence '\-'
Based on https://github.com/erikrose/parsimonious/issues/246 this seems to be due to Python getting more aggressive about escape sequences. It also looks like there's a fairly straightforward fix that involves marking the string as a raw string, which I've done in this patch. After making that change the invalid escape sequence messages go away.