Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use ne for comparison against non literal #1152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ryo-tagami
Copy link

Use != for comparison against non-literal, since Python >= 3.8 emits a warning about it.

.../.venv/lib/python3.9/site-packages/jnpr/junos/device.py:909: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if rpc_rsp_e.text is not None and rpc_rsp_e.text.strip() is not "":
.../.venv/lib/python3.9/site-packages/jnpr/junos/device.py:1330: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if auto_probe is not 0:
.../.venv/lib/python3.9/site-packages/jnpr/junos/rpcmeta.py:157: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if model and filter_xml is None and options.get("format") is not "json":
.../.venv/lib/python3.9/site-packages/jnpr/junos/utils/start_shell.py:147: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  self.last_ok = got is not ""

Signed-off-by: Ryo Tagami rtagami@airstrip.jp

Use `!=` for comparison against non-literal, since Python >= 3.8 emits a
warning about it.

```
.../.venv/lib/python3.9/site-packages/jnpr/junos/device.py:909: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if rpc_rsp_e.text is not None and rpc_rsp_e.text.strip() is not "":
.../.venv/lib/python3.9/site-packages/jnpr/junos/device.py:1330: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if auto_probe is not 0:
.../.venv/lib/python3.9/site-packages/jnpr/junos/rpcmeta.py:157: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if model and filter_xml is None and options.get("format") is not "json":
.../.venv/lib/python3.9/site-packages/jnpr/junos/utils/start_shell.py:147: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  self.last_ok = got is not ""
```

Signed-off-by: Ryo Tagami <rtagami@airstrip.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant