File: 0005-fix-weird-non-idiomatic-line.patch

package info (click to toggle)
python-whoosh 2.7.4%2Bgit6-g9134ad92-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,804 kB
  • sloc: python: 38,552; makefile: 118
file content (25 lines) | stat: -rw-r--r-- 992 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From d9a3fa2a4905e7326c9623c89e6395713c189161 Mon Sep 17 00:00:00 2001
From: Matt Chaput <matt@whoosh.ca>
Date: Sat, 15 Jan 2022 13:08:37 -0500
Subject: [PATCH] Fix weird non-idiomatic line

You should compare to an int using == not is (even though technically the int is implemented as a singleton object).
Not sure how or why I typed this originally.
Thanks to Philipp Kolmann for pointing this out.
---
 src/whoosh/codec/whoosh3.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/whoosh/codec/whoosh3.py b/src/whoosh/codec/whoosh3.py
index 14b12205..a6b982a0 100644
--- a/src/whoosh/codec/whoosh3.py
+++ b/src/whoosh/codec/whoosh3.py
@@ -1117,7 +1117,7 @@ def _read_values(self):
         vs = self._data[2]
         if fixedsize is None or fixedsize < 0:
             self._values = vs
-        elif fixedsize is 0:
+        elif fixedsize == 0:
             self._values = (None,) * self._blocklength
         else:
             assert isinstance(vs, bytes_type)