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

v.surf.nnbathy: Fix exception type for Python 3 #981

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

wenzeslaus
Copy link
Member

Fixes both v.surf.nnbathy and r.surf.nnbathy because r.surf.nnbathy imports the Python module installed with v.surf.nnbathy.

Fixes Pylint error E0602: Undefined variable 'StandardError' (undefined-variable), but introduces warning W0718: Catching too general exception Exception (broad-exception-caught).

This is aiming at making the tool run with Python 3 and GRASS GIS 8. Proper fix would separate try-except blocks to the relevant parts. Now two string splits, all vector handling and file writing are all in one try-except which catches everything including IndexError and AttributeError. This basic fix is just applying The Conservative Python 3 Porting Guide without further changes.

Fixes both v.surf.nnbathy and r.surf.nnbathy because r.surf.nnbathy imports the Python module installed with v.surf.nnbathy.

Fixes Pylint error E0602: Undefined variable 'StandardError' (undefined-variable), but introduces warning W0718: Catching too general exception Exception (broad-exception-caught).

This is aiming at making the tool run with Python 3 and GRASS GIS 8. Proper fix would separate try-except blocks to the relevant parts. Now two string splits, all vector handling and file writing are all in one try-except which catches everything including IndexError and AttributeError. This basic fix is just applying The Conservative Python 3 Porting Guide without further changes.
@wenzeslaus wenzeslaus merged commit 1767c5f into OSGeo:grass8 Nov 9, 2023
7 checks passed
@wenzeslaus wenzeslaus deleted the fix-python2-exception-type branch November 9, 2023 20:37
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.

[Bug] v.surf.nnbathy: NameError: StandardError is not defined
2 participants