Skip to content

Commit 4ca72de

Browse files
committed
Python: Fix recommended module for deprecated posixfile
$ python2 -W default -c 'import posixfile' -c:1: DeprecationWarning: The posixfile module is deprecated; fcntl.lockf() provides better locking https://docs.python.org/2.7/library/posixfile.html
1 parent 6c7cddf commit 4ca72de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/ql/src/Imports/DeprecatedModule.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import python
1717
* and module `instead` should be used instead (or `instead = "no replacement"`)
1818
*/
1919
predicate deprecated_module(string name, string instead, int major, int minor) {
20-
name = "posixfile" and instead = "email" and major = 1 and minor = 5
20+
name = "posixfile" and instead = "fcntl" and major = 1 and minor = 5
2121
or
2222
name = "gopherlib" and instead = "no replacement" and major = 2 and minor = 5
2323
or
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
| test.py:2:8:2:13 | ImportExpr | The rfc822 module was deprecated in version 2.3. Use email module instead. |
2-
| test.py:3:8:3:16 | ImportExpr | The posixfile module was deprecated in version 1.5. Use email module instead. |
2+
| test.py:3:8:3:16 | ImportExpr | The posixfile module was deprecated in version 1.5. Use fcntl module instead. |
33
| test.py:8:16:8:18 | ImportExpr | The md5 module was deprecated in version 2.5. Use hashlib module instead. |

0 commit comments

Comments
 (0)