From 2f3323500d1a1fa974c91ee2266d982920c915c0 Mon Sep 17 00:00:00 2001 From: Johann Queuniet Date: Tue, 7 Apr 2020 14:53:37 +0200 Subject: [PATCH] Fixes deprecation notices with Python 3.8 --- prettytable/prettytable.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/prettytable/prettytable.py b/prettytable/prettytable.py index 02dab66..1153ae1 100644 --- a/prettytable/prettytable.py +++ b/prettytable/prettytable.py @@ -421,7 +421,7 @@ def align(self): def align(self, val): if not self._field_names: self._align = {} - elif val is None or (isinstance(val, dict) and len(val) is 0): + elif val is None or (isinstance(val, dict) and len(val) == 0): for field in self._field_names: self._align[field] = "c" else: @@ -441,7 +441,7 @@ def valign(self): def valign(self, val): if not self._field_names: self._valign = {} - elif val is None or (isinstance(val, dict) and len(val) is 0): + elif val is None or (isinstance(val, dict) and len(val) == 0): for field in self._field_names: self._valign[field] = "t" else: @@ -459,7 +459,7 @@ def max_width(self): @max_width.setter def max_width(self, val): - if val is None or (isinstance(val, dict) and len(val) is 0): + if val is None or (isinstance(val, dict) and len(val) == 0): self._max_width = {} else: self._validate_option("max_width", val) @@ -489,7 +489,7 @@ def min_width(self): @min_width.setter def min_width(self, val): - if val is None or (isinstance(val, dict) and len(val) is 0): + if val is None or (isinstance(val, dict) and len(val) == 0): self._min_width = {} else: self._validate_option("min_width", val) @@ -687,7 +687,7 @@ def int_format(self): @int_format.setter def int_format(self, val): - if val is None or (isinstance(val, dict) and len(val) is 0): + if val is None or (isinstance(val, dict) and len(val) == 0): self._int_format = {} else: self._validate_option("int_format", val) @@ -704,7 +704,7 @@ def float_format(self): @float_format.setter def float_format(self, val): - if val is None or (isinstance(val, dict) and len(val) is 0): + if val is None or (isinstance(val, dict) and len(val) == 0): self._float_format = {} else: self._validate_option("float_format", val)