52 lines
2.2 KiB
Diff
52 lines
2.2 KiB
Diff
From 916b446317980e9794a02bfb79456da4fc2768a4 Mon Sep 17 00:00:00 2001
|
|
From: Jordan Justen <jordan.l.justen@intel.com>
|
|
Date: Thu, 9 Apr 2020 02:26:27 -0700
|
|
Subject: [PATCH] Fix 'SyntaxWarning: "is" with a literal.' from Python 3.8
|
|
|
|
alot/alot/widgets/ansi.py:84: SyntaxWarning: "is" with a literal. Did you mean "=="?
|
|
if code is 0:
|
|
alot/alot/commands/envelope.py:762: SyntaxWarning: "is" with a literal. Did you mean "=="?
|
|
if self.action is "txt2html":
|
|
alot/alot/commands/envelope.py:768: SyntaxWarning: "is" with a literal. Did you mean "=="?
|
|
elif self.action is "html2txt":
|
|
|
|
Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955193
|
|
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
|
|
---
|
|
alot/commands/envelope.py | 4 ++--
|
|
alot/widgets/ansi.py | 2 +-
|
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
|
|
index 9c2fbbc54..ba0b4dbc9 100644
|
|
--- a/alot/commands/envelope.py
|
|
+++ b/alot/commands/envelope.py
|
|
@@ -759,13 +759,13 @@ def apply(self, ui):
|
|
ebuffer = ui.current_buffer
|
|
envelope = ebuffer.envelope
|
|
|
|
- if self.action is "txt2html":
|
|
+ if self.action == "txt2html":
|
|
fallbackcmd = settings.get('envelope_txt2html')
|
|
cmd = self.cmd or split_commandstring(fallbackcmd)
|
|
if cmd:
|
|
envelope.body_html = self.convert(cmd, envelope.body_txt)
|
|
|
|
- elif self.action is "html2txt":
|
|
+ elif self.action == "html2txt":
|
|
fallbackcmd = settings.get('envelope_html2txt')
|
|
cmd = self.cmd or split_commandstring(fallbackcmd)
|
|
if cmd:
|
|
diff --git a/alot/widgets/ansi.py b/alot/widgets/ansi.py
|
|
index 97a4fb95c..4aaf28e7e 100644
|
|
--- a/alot/widgets/ansi.py
|
|
+++ b/alot/widgets/ansi.py
|
|
@@ -81,7 +81,7 @@ def parse_escapes_to_urwid(text, default_attr=None, default_attr_focus=None,
|
|
i = 0
|
|
while i < len(esc_code):
|
|
code = esc_code[i]
|
|
- if code is 0:
|
|
+ if code == 0:
|
|
attr.update({'bold': default_attr.bold,
|
|
'underline': default_attr.underline,
|
|
'standout': default_attr.standout})
|