-
Notifications
You must be signed in to change notification settings - Fork 83
Fix regex tests on Python 3.14 #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| if os.sep == '\\': | ||
| sep = re.escape(os.sep) | ||
| sep = re.escape(os.sep) if os.sep == '\\' else os.sep | ||
| # https://docs.python.org/3/whatsnew/3.14.html#re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also ref python/cpython#140922
| sep = os.sep | ||
| if os.sep == '\\': | ||
| sep = re.escape(os.sep) | ||
| sep = re.escape(os.sep) if os.sep == '\\' else os.sep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
| sep = re.escape(os.sep) if os.sep == '\\' else os.sep | |
| sep = r"\\" if os.sep == "\\" else os.sep |
or even:
| sep = re.escape(os.sep) if os.sep == '\\' else os.sep | |
| sep = re.escape(os.sep) |
f8db9de to
9ac82dc
Compare
| # function) -- authors of new compiler interface classes are | ||
| # responsible for updating 'compiler_class'! | ||
| compiler_type: ClassVar[str] = None # type: ignore[assignment] | ||
| compiler_type: ClassVar[str] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be added back in #368 , but tests currently fails with this due to unused type-ignore
Fixes #381
This updates tests expectations, but alternatively I can update
glob_to_re's implementation to always capitalize\zso that the result stays consistent across Python versions (at least for as long as\Zstays supported, which I guess is gonna be quite a while)