Skip to content

Commit c4bfb21

Browse files
authored
Merge pull request #13371 from github/nickrolfe/python-location-tostring
Python: avoid selecting `getLocation()`
2 parents 0e6693b + 0239586 commit c4bfb21

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

python/ql/src/Expressions/TruncatedDivision.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ where
3434
)
3535
)
3636
select div, "Result of division may be truncated as its $@ and $@ arguments may both be integers.",
37-
left.getLocation(), "left", right.getLocation(), "right"
37+
left, "left", right, "right"

python/ql/src/Statements/UnnecessaryDelete.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ where
3636
ex = Value::named("sys.exc_info") and
3737
ex.getACall().getScope() = f
3838
)
39-
select del, "Unnecessary deletion of local variable $@ in function $@.", e.getLocation(),
40-
e.toString(), f.getLocation(), f.getName()
39+
select del, "Unnecessary deletion of local variable $@ in function $@.", e, e.toString(), f,
40+
f.getName()
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| TruncatedDivision_test.py:65:7:65:11 | BinaryExpr | Result of division may be truncated as its $@ and $@ arguments may both be integers. | TruncatedDivision_test.py:65:7:65:7 | TruncatedDivision_test.py:65 | left | TruncatedDivision_test.py:65:11:65:11 | TruncatedDivision_test.py:65 | right |
2-
| TruncatedDivision_test.py:72:7:72:35 | BinaryExpr | Result of division may be truncated as its $@ and $@ arguments may both be integers. | TruncatedDivision_test.py:25:12:25:12 | TruncatedDivision_test.py:25 | left | TruncatedDivision_test.py:28:12:28:12 | TruncatedDivision_test.py:28 | right |
1+
| TruncatedDivision_test.py:65:7:65:11 | BinaryExpr | Result of division may be truncated as its $@ and $@ arguments may both be integers. | TruncatedDivision_test.py:65:7:65:7 | ControlFlowNode for IntegerLiteral | left | TruncatedDivision_test.py:65:11:65:11 | ControlFlowNode for IntegerLiteral | right |
2+
| TruncatedDivision_test.py:72:7:72:35 | BinaryExpr | Result of division may be truncated as its $@ and $@ arguments may both be integers. | TruncatedDivision_test.py:25:12:25:12 | ControlFlowNode for IntegerLiteral | left | TruncatedDivision_test.py:28:12:28:12 | ControlFlowNode for IntegerLiteral | right |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| statements_test.py:187:5:187:9 | Delete | Unnecessary deletion of local variable $@ in function $@. | statements_test.py:187:9:187:9 | statements_test.py:187 | x | statements_test.py:185:1:185:31 | statements_test.py:185 | error_unnecessary_delete |
1+
| statements_test.py:187:5:187:9 | Delete | Unnecessary deletion of local variable $@ in function $@. | statements_test.py:187:9:187:9 | x | x | statements_test.py:185:1:185:31 | Function error_unnecessary_delete | error_unnecessary_delete |

0 commit comments

Comments
 (0)