Skip to content

Commit 909f572

Browse files
Minor doc updates; updating python 2 references to python 3 and updating grammar
1 parent 7a7db0e commit 909f572

11 files changed

+20
-20
lines changed

python/ql/src/Exceptions/CatchingBaseException.qhelp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ leaving <code>KeyboardInterrupt</code> to propagate.
4545
</example>
4646
<references>
4747

48-
<li>Python Language Reference: <a href="http://docs.python.org/2.7/reference/compound_stmts.html#try">The try statement</a>,
49-
<a href="http://docs.python.org/2.7/reference/executionmodel.html#exceptions">Exceptions</a>.</li>
48+
<li>Python Language Reference: <a href="http://docs.python.org/3/reference/compound_stmts.html#try">The try statement</a>,
49+
<a href="http://docs.python.org/3/reference/executionmodel.html#exceptions">Exceptions</a>.</li>
5050
<li>M. Lutz, Learning Python, Section 35.3: Exception Design Tips and Gotchas, O'Reilly Media, 2013.</li>
51-
<li>Python Tutorial: <a href="https://docs.python.org/2/tutorial/errors.html">Errors and Exceptions</a>.</li>
51+
<li>Python Tutorial: <a href="https://docs.python.org/3/tutorial/errors.html">Errors and Exceptions</a>.</li>
5252

5353

5454
</references>

python/ql/src/Exceptions/EmptyExcept.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
The loss of information can lead to hard to debug errors and incomplete log files.
88
It is even possible that ignoring an exception can cause a security vulnerability.
99
An empty <code>except</code> block may be an indication that the programmer intended to
10-
handle the exception but never wrote the code to do so.</p>
10+
handle the exception, but never wrote the code to do so.</p>
1111

1212
</overview>
1313
<recommendation>
1414
<p>Ensure all exceptions are handled correctly.</p>
1515

1616
</recommendation>
1717
<example>
18-
<p>In this example the program keeps running with the same privileges if it fails to drop to lower
18+
<p>In this example, the program keeps running with the same privileges if it fails to drop to lower
1919
privileges.</p>
2020
<sample src="EmptyExcept.py" />
2121

python/ql/src/Expressions/CallToSuperWrongClass.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ However, this may result in incorrect object initialization if the enclosing cla
2424
</recommendation>
2525
<example>
2626
<p>
27-
In this example the call to <code>super(Vehicle, self)</code> in <code>Car.__init__</code> is incorrect as it
27+
In this example, the call to <code>super(Vehicle, self)</code> in <code>Car.__init__</code> is incorrect, as it
2828
passes <code>Vehicle</code> rather than <code>Car</code> as the first argument to <code>super</code>.
2929
As a result, <code>super(SportsCar, self).__init__()</code> in the <code>SportsCar.__init__</code> method will not call
3030
all <code>__init__()</code> methods because the call to <code>super(Vehicle, self).__init__()</code>
@@ -37,7 +37,7 @@ skips <code>StatusSymbol.__init__()</code>.
3737
</example>
3838
<references>
3939

40-
<li>Python Standard Library: <a href="https://docs.python.org/2/library/functions.html#super">super</a>.</li>
40+
<li>Python Standard Library: <a href="https://docs.python.org/3/library/functions.html#super">super</a>.</li>
4141
<li>Artima Developer: <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=236275">Things to Know About Python Super</a>.</li>
4242

4343

python/ql/src/Expressions/ExplicitCallToDel.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ wrap the use of the object in a <code>with</code> statement.
1717

1818
</recommendation>
1919
<example>
20-
<p>In the first example, rather than close the zip file in a conventional manner the programmer has called <code>__del__</code>.
20+
<p>In the first example, rather than close the zip file in a conventional manner, the programmer has called <code>__del__</code>.
2121
A safer alternative is shown in the second example.
2222
</p>
2323

python/ql/src/Expressions/IncorrectComparisonUsingIs.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ either of the alternatives below.
3737
</example>
3838
<references>
3939

40-
<li>Python Standard Library: <a href="http://docs.python.org/2/library/stdtypes.html#comparisons">Comparisons</a>.</li>
40+
<li>Python Standard Library: <a href="http://docs.python.org/3/library/stdtypes.html#comparisons">Comparisons</a>.</li>
4141

4242
</references>
4343
</qhelp>

python/ql/src/Expressions/IncorrectComparisonUsingIs.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Comparison using is when operands support `__eq__`
3-
* @description Comparison using 'is' when equivalence is not the same as identity
3+
* @description Comparison using `is` when equivalence is not the same as identity
44
* @kind problem
55
* @tags quality
66
* reliability

python/ql/src/Functions/ConsistentReturns.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<overview>
88
<p>When a function contains both explicit returns (<code>return value</code>) and implicit returns
9-
(where code falls off the end of a function) this often indicates that a return
9+
(where code falls off the end of a function), this often indicates that a return
1010
statement has been forgotten. It is best to return an explicit return value even when returning
1111
<code>None</code> because this makes it easier for other developers to read your code.
1212
</p>
@@ -29,7 +29,7 @@ return value of <code>None</code> as this equates to <code>False</code>. However
2929
</example>
3030
<references>
3131

32-
<li>Python Language Reference: <a href="http://docs.python.org/2/reference/compound_stmts.html#function">Function definitions</a>.
32+
<li>Python Language Reference: <a href="http://docs.python.org/3/reference/compound_stmts.html#function">Function definitions</a>.
3333
</li>
3434

3535

python/ql/src/Functions/ConsistentReturns.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @name Explicit returns mixed with implicit (fall through) returns
3-
* @description Mixing implicit and explicit returns indicates a likely error as implicit returns always return 'None'.
3+
* @description Mixing implicit and explicit returns indicates a likely error as implicit returns always return `None`.
44
* @kind problem
55
* @tags quality
66
* reliability
@@ -31,4 +31,4 @@ predicate has_implicit_return(Function func) {
3131
from Function func
3232
where explicitly_returns_non_none(func) and has_implicit_return(func)
3333
select func,
34-
"Mixing implicit and explicit returns may indicate an error as implicit returns always return None."
34+
"Mixing implicit and explicit returns may indicate an error, as implicit returns always return None."

python/ql/src/Functions/InitIsGenerator.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ not logical in the context of an initializer.</p>
2222
</example>
2323
<references>
2424

25-
<li>Python: <a href="http://docs.python.org/2.7/reference/datamodel.html#object.__init__">The __init__ method</a>.</li>
25+
<li>Python: <a href="http://docs.python.org/3/reference/datamodel.html#object.__init__">The __init__ method</a>.</li>
2626

2727
</references>
2828
</qhelp>

python/ql/src/Functions/ModificationOfParameterWithDefault.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function with a default of <code>default=None</code>, check if the parameter is
3737
<references>
3838

3939
<li>Effbot: <a href="https://web.archive.org/web/20201112004749/http://effbot.org/zone/default-values.htm">Default Parameter Values in Python</a>.</li>
40-
<li>Python Language Reference: <a href="http://docs.python.org/2/reference/compound_stmts.html#function-definitions">Function definitions</a>.</li>
40+
<li>Python Language Reference: <a href="http://docs.python.org/3/reference/compound_stmts.html#function-definitions">Function definitions</a>.</li>
4141

4242

4343
</references>

0 commit comments

Comments
 (0)