Skip to content
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

Remove warning about invalid escape sequence #89

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Conversation

ashb
Copy link
Contributor

@ashb ashb commented Mar 27, 2024

Python 3.12 now issues this as a warning at runtime, not just a flake8/linter error.

I'm not quite sure why my script complains about this when python -c 'import beaupy._internals' doesn't, but it seems like an easy fix:

shell ❯ ./py312-test/bin/teleport-assume
/Users/ash/code/astro/teleport-assume/py312-test/lib/python3.12/site-packages/beaupy/_internals.py:60: SyntaxWarning: invalid escape sequence '\['
  prefix = '\[{}]'.format(' ' * len(_replace_emojis(tick_character)))  # noqa: W605
/Users/ash/code/astro/teleport-assume/py312-test/lib/python3.12/site-packages/beaupy/_internals.py:62: SyntaxWarning: invalid escape sequence '\['
  prefix = f'\[[{tick_style}]{tick_character}[/{tick_style}]]'  # noqa: W605

This was the output I got on startup of my script. (Maybe some other module I imported changed the default warnings filter 🤷🏻 )

Python 3.12 now issues this as a warning at runtime, not just a flake8/linter error
beaupy/_internals.py Outdated Show resolved Hide resolved
@petereon
Copy link
Owner

Thanks for the contribution! I'll merge and release today

@petereon petereon merged commit 1b4d7c6 into petereon:master Mar 27, 2024
@ashb ashb deleted the patch-1 branch March 28, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants