diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2023-08-15 17:13:17 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2023-08-15 17:56:59 +0300 |
commit | f2764f165b23b2e9ae03849c84fb7ed310ed12b7 (patch) | |
tree | 7563061bde0c8db6217ae298e81aa34f82e25b23 /calm/untest.py | |
parent | 68e2201f28238209dc58f81a82ba5e3ccdf4d0f5 (diff) |
Explicitly use count keyword argument to re.sub()
This avoids flake B034: sub should pass `count` and `flags` as keyword
arguments to avoid confusion due to unintuitive argument positions.
Diffstat (limited to 'calm/untest.py')
-rw-r--r-- | calm/untest.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/calm/untest.py b/calm/untest.py index 7d6d774..7744108 100644 --- a/calm/untest.py +++ b/calm/untest.py @@ -53,7 +53,7 @@ def untest(pvr): content = fh.read() if re.search(r'^test:', content, re.MULTILINE): - content = re.sub(r'^test:\s*$', '', content, 0, re.MULTILINE) + content = re.sub(r'^test:\s*$', '', content, count=0, flags=re.MULTILINE) with open(fn, 'w') as fh: fh.write(content) |