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

S_str must be a positive integer greater than 0. #1

Open
smutt opened this issue Dec 2, 2024 · 2 comments
Open

S_str must be a positive integer greater than 0. #1

smutt opened this issue Dec 2, 2024 · 2 comments

Comments

@smutt
Copy link
Collaborator

smutt commented Dec 2, 2024

Line 54:
S_str must be a positive integer greater than 0.

Currently we only check that it can be cast to an INT.

https://docs.python.org/3/library/functions.html#int

@paulehoffman
Copy link
Contributor

paulehoffman commented Dec 4, 2024

Good catch. Fixed by e910e90

@smutt
Copy link
Collaborator Author

smutt commented Dec 4, 2024

That's a rather overcomplicated hack. The indentation isn't even correct.

How about?

try:
S = int(S_str)
if S < 1:
raise ValueError('S must be a whole number')
except as err:
print(repr(err))
sys.exit(1)

@smutt smutt reopened this Dec 4, 2024
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

No branches or pull requests

2 participants