fix: is_online_change_possible is a property on SP21, not a method
Live verification against CODESYS V3.5 SP21 Patch 5: calling it raised 'bool is not callable'. Handle both the property (SP21) and callable (stub-documented) shapes.
This commit is contained in:
parent
4c5ec53473
commit
52f8746268
1 changed files with 5 additions and 1 deletions
|
|
@ -15,7 +15,11 @@ try:
|
||||||
|
|
||||||
if not hasattr(target_app, 'is_online_change_possible'):
|
if not hasattr(target_app, 'is_online_change_possible'):
|
||||||
raise TypeError("is_online_change_possible is not available on this SP (needs 3.5.10.0+).")
|
raise TypeError("is_online_change_possible is not available on this SP (needs 3.5.10.0+).")
|
||||||
possible = target_app.is_online_change_possible()
|
# Property on SP21 (returns bool directly); method on the SPs the stub
|
||||||
|
# documents. Handle both.
|
||||||
|
possible = target_app.is_online_change_possible
|
||||||
|
if callable(possible):
|
||||||
|
possible = possible()
|
||||||
|
|
||||||
print("Application: %s" % app_name)
|
print("Application: %s" % app_name)
|
||||||
print("Online Change Possible: %s" % possible)
|
print("Online Change Possible: %s" % possible)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue