forked from OSGeo/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize Python syntax, resolves Python 3.12
\.
Syntax warning (OS…
…Geo#3316) * Fix unnecessary future import See https://docs.astral.sh/ruff/rules/unnecessary-future-import/ https://github.com/asottile/pyupgrade?tab=readme-ov-file#__future__-import-removal * python: Fix remaining useless object inheritance See https://docs.astral.sh/ruff/rules/useless-object-inheritance/ * Fix some checks of type, where the type is already a primitive. See https://docs.astral.sh/ruff/rules/type-of-primitive/ * Fix remaining check of type of primitive. Might need a second look to make sure the message protocol handled strings correctly. The check was different than others. See https://docs.astral.sh/ruff/rules/type-of-primitive/ * Fix unnecessary calls to functions instead of native literals See https://docs.astral.sh/ruff/rules/native-literals/ * Use generator expressions when list comprehension is immediately unpacked. See https://docs.astral.sh/ruff/rules/unpacked-list-comprehension/ * Use builtin open instead of python3' alias io.open See https://docs.astral.sh/ruff/rules/open-alias/ * Use `yield from` when a simple yield in a for loop is used. Supported since Python 3.3. See https://docs.astral.sh/ruff/rules/yield-in-for-loop/ * Convert additional `yield` usage inside a list to a `yield from` * Removed extra parentheses where obviously unneeded Some other cases were flagged and could have been automatically fixed, but I wasn't confident enough to apply them now. See https://docs.astral.sh/ruff/rules/extraneous-parentheses/ * Removed extra parentheses in `.BestSize((self.xx.GetBestSize()))` calls Some existing calls already called it without the extra parentheses. From the wxPython docs, I understand that GetBestSize returns a wx.Size object, and the BestSize() can accept wx.size, a tuple of (x,y), or two arguments, like x and y separately (at least for https://docs.wxpython.org/wx.lib.agw.aui.framemanager.AuiPaneInfo.html?highlight=bestsize#wx.lib.agw.aui.framemanager.AuiPaneInfo.BestSize) * Removed a Python 2.6 version block for json.loads kwargs See https://docs.astral.sh/ruff/rules/outdated-version-block/ * Use raw strings when using `\.` The sequence `\.` is an undefined escape sequence, but can be found in regex-strings. In regex strings, we usually want the backslash character and the dot character, instead of escaping dot like if it was a tab character `\t`. This is what raw strings (strings prefixed with r) do: they treat backslashes as literal characters. In Python 3.12, using `\.` in a string (not raw strings) raises `SyntaxWarning: invalid escape sequence '\.'` * Apply suggestion from code review * Revert "Convert additional `yield` usage inside a list to a `yield from`" This reverts commit 3b2bb8c.
- Loading branch information
Showing
39 changed files
with
67 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.