Script runner debugger can't print object properties directly #2302 #2367
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2302
Using the example in the linked issue, the problem in the current logic is that
self.script_binding[1]contains kv's like:The
printis added and the statement eval'd only if thedebug_textis directly found as a key in that dict. Sofoowill print,bazwith print afterbaz = foo.bar, butfoo.baris not a dict key and therefore will not eval. By splitting thedebug_textby dot and taking the first element, that at least checks if the base instance variable exists.If you try
foo.baz(an attribute that doesn't exist), you getAttributeError : 'Foo' object has no attribute 'baz'which is useful and expected.Validation
Following the same repro steps, you can now type
foo.barand it will correctly eval to123: