Skip to content

Comments

fix(PyQt5toPyQt6): check if object has an attribute id#61221

Merged
nyalldawson merged 1 commit intoqgis:masterfrom
Guts:patch-1
Mar 28, 2025
Merged

fix(PyQt5toPyQt6): check if object has an attribute id#61221
nyalldawson merged 1 commit intoqgis:masterfrom
Guts:patch-1

Conversation

@Guts
Copy link
Contributor

@Guts Guts commented Mar 27, 2025

Error fixed running the migration script on a certain plugin:

Traceback (most recent call last):
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 892, in <module>
    raise SystemExit(main())
                     ^^^^^^
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 887, in main
    ret |= fix_file(filename, not args.qgis3_incompatible_changes, dry_run)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 461, in fix_file
    visit_call(node, parent)
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 338, in visit_call
    and _node.args[0].func.id == "QDate"
        ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Attribute' object has no attribute 'id'

Description

[Replace this with some text explaining the rationale and details about this pull request]

cc @jmkerloch @florentfougeres @troopa81

Error fixed running the migration script on a certain plugin:

```python
Traceback (most recent call last):
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 892, in <module>
    raise SystemExit(main())
                     ^^^^^^
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 887, in main
    ret |= fix_file(filename, not args.qgis3_incompatible_changes, dry_run)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 461, in fix_file
    visit_call(node, parent)
  File "/usr/local/bin/pyqt5_to_pyqt6.py", line 338, in visit_call
    and _node.args[0].func.id == "QDate"
        ^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Attribute' object has no attribute 'id'
```
@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2025

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 85b00a1)

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 85b00a1)

@github-actions github-actions bot added this to the 3.44.0 milestone Mar 27, 2025
@florentfougeres
Copy link
Contributor

Thanks @Guts

@nyalldawson nyalldawson merged commit 99637cc into qgis:master Mar 28, 2025
35 checks passed
@Guts Guts deleted the patch-1 branch March 29, 2025 07:55
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.

3 participants