diff options
author | Mingwei Zhang <digizeph@users.noreply.github.com> | 2020-03-04 10:32:39 -0800 |
---|---|---|
committer | Jakub Stasiak <jakub@stasiak.at> | 2020-06-14 17:54:39 +0200 |
commit | ab303906f5474dc860111e4c90e70db9b2a09c12 (patch) | |
tree | 77593df345a03df1b5560f406872744518def12e | |
parent | f132628a4faf897f7fc986b0c07c5525035f7ec4 (diff) | |
download | netaddr-test.tar.gz |
Fix warning of using `is not` for string comparetest
Fix the following warning in python3.8
```
/usr/local/lib/python3.8/site-packages/netaddr-0.7.19-py3.8.egg/netaddr/strategy/__init__.py:189: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if word_sep is not '':
```
-rw-r--r-- | netaddr/strategy/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/netaddr/strategy/__init__.py b/netaddr/strategy/__init__.py index 0d2c446..7b5861d 100644 --- a/netaddr/strategy/__init__.py +++ b/netaddr/strategy/__init__.py @@ -186,7 +186,7 @@ def int_to_bits(int_val, word_size, num_words, word_sep=''): bits = ('0' * word_size + bit_str)[-word_size:] bit_words.append(bits) - if word_sep is not '': + if word_sep != '': # Check custom separator. if not _is_str(word_sep): raise ValueError('word separator is not a string: %r!' % (word_sep,)) |