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

if-else expression under python3.12 cannot be formatted #210

Closed
y9c opened this issue Jan 4, 2024 · 1 comment · Fixed by #213
Closed

if-else expression under python3.12 cannot be formatted #210

y9c opened this issue Jan 4, 2024 · 1 comment · Fixed by #213
Labels
bug Something isn't working

Comments

@y9c
Copy link

y9c commented Jan 4, 2024

Input file:

a = f"{1 + 2}"  if 1 > 0 else   f"{1 - 2}"

Error:

snakefmt.exceptions.InvalidPython: Black error:

Cannot parse: 1:22: a =f"{1 + 2}"if 1 > 0 elsef"{1 - 2}"

(Note reported line number may be incorrect, as snakefmt could not determine the true line number)

version information:

  • snakefmt, version 0.8.5
  • black, 23.12.1 (compiled: yes)
  • Python 3.12.0
@y9c y9c changed the title if-else express under python3.12 cannot be formatted if-else expression under python3.12 cannot be formatted Jan 4, 2024
@mbhall88
Copy link
Member

mbhall88 commented Jan 4, 2024

Just confirming I can reproduce this. Seems to only fail on python 3.12 for some weird reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants