mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
fix(PyQt5toPyQt6): check if object has an attribute id
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' ```
This commit is contained in:
parent
f2f0de0bc5
commit
99637cc430
@ -335,6 +335,7 @@ def fix_file(filename: str, qgis3_compat: bool, dry_run: bool = False) -> int:
|
||||
elif (
|
||||
len(_node.args) == 1
|
||||
and isinstance(_node.args[0], ast.Call)
|
||||
and hasattr(_node.args[0].func, "id")
|
||||
and _node.args[0].func.id == "QDate"
|
||||
):
|
||||
# QDateTime(QDate(..)) doesn't work anymore,
|
||||
|
Loading…
x
Reference in New Issue
Block a user