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

Pronterface broken in Python 3.9 or older #1362

Closed
rockstorm101 opened this issue Jun 15, 2023 · 5 comments · Fixed by #1367
Closed

Pronterface broken in Python 3.9 or older #1362

rockstorm101 opened this issue Jun 15, 2023 · 5 comments · Fixed by #1367
Milestone

Comments

@rockstorm101
Copy link
Collaborator

I just realized that on #1331 we introduced code that only runs under Python 3.10 or newer, meaning that it throws an "invalid syntax error" when run under Python 3.9.

So, options:

  1. Change the code to be compatible with older versions? or
  2. Acknowledge and accept that the next Printrun 2.1 release will be only for Python >= 3.10?

Just a note on Debian/Ubuntu ecosystem, Ubuntu 20.04 (which ships Python 3.8) is supported until 2025.

@kliment
Copy link
Owner

kliment commented Jun 15, 2023

If that's the only place it's used, I think reworking it to be a bunch of elifs is reasonable.

@kliment
Copy link
Owner

kliment commented Jun 15, 2023

The other way to reformat it would be a bunch of dictionaries. It might actually be a better use case for readability. We'd then have one dictionary per platform.

@neofelis2X
Copy link
Contributor

Damn, that’s true. But I have already rewritten the whole function with a dictionary. I realised that it’s not a very elegant approach.
It’s in one of my branches, but I can also push it as a separate PR if you prefer that.

We'd then have one dictionary per platform.

That’s almost exactly what I did in the new version. 😅

@rockstorm101
Copy link
Collaborator Author

It’s in one of my branches, but I can also push it as a separate PR if you prefer that.

Hi @neofelis2X I'm not sure I understand 100% what you mean here sorry. If you were going to submit the rewritten function as part of a bigger PR, then that's OK with me, it can wait. If you weren't going to submit it but happen to have that function already rewritten, then yes please send a PR with the "fix" :)

@neofelis2X
Copy link
Contributor

Yes I have the rewritten function as part of a PR that I will push as soon as it’s completed and tested. sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants