File: is-not.patch

package info (click to toggle)
python-clint 0.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 328 kB
  • sloc: python: 1,815; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 869 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
Description: Use "!=" instead of "is not" for value comparisons.
 Python 3.8 warns about a misuse of "is not" that will technically work
 since Python keeps a cache of some predefined objects for e.g. small
 integers, it is still not a good idea to compare integers and string
 literals with "is".
Forwarded: no
Author: Peter Pentchev <roam@ringlet.net>
Last-Update: 2020-02-09

--- a/clint/eng.py
+++ b/clint/eng.py
@@ -41,7 +41,7 @@
 
             collector.append(conj)
 
-        elif left is not 0:
+        elif left != 0:
             collector.append(separator)
 
     return unicode(str().join(collector))
--- a/clint/textui/prompt.py
+++ b/clint/textui/prompt.py
@@ -65,7 +65,7 @@
         validators = [RegexValidator(r'.+')]
 
     # Let's build the prompt
-    if prompt[-1] is not ' ':
+    if prompt[-1] != ' ':
         prompt += ' '
 
     if default: