-1

When I run the command sudo apt update && sudo apt upgrade, everything upgrades as usual but towards the end I get the error

/usr/lib/python3/dist-packages/pyVNC/Client.py:61: SyntaxWarning: "is" with a literal. Did you mean "=="? if event is "Left": /usr/lib/python3/dist-packages/pyVNC/Client.py:63: SyntaxWarning: "is" with a literal. Did you mean "=="? elif event is "Middle": /usr/lib/python3/dist-packages/pyVNC/Client.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="? elif event is "Right": /usr/lib/python3/dist-packages/pyVNC/Client.py:61: SyntaxWarning: "is" with a literal. Did you mean "=="? if event is "Left": /usr/lib/python3/dist-packages/pyVNC/Client.py:63: SyntaxWarning: "is" with a literal. Did you mean "=="? elif event is "Middle": /usr/lib/python3/dist-packages/pyVNC/Client.py:65: SyntaxWarning: "is" with a literal. Did you mean "=="? elif event is "Right" 

I have tried looking at the code but nothing comes to mind. Any idea on how to fix?

1
  • 1
    It looks like a Warning, not an Error. I guess it's not alone and there are more lines into the output.
    – thanasisp
    CommentedMay 27, 2022 at 21:55

1 Answer 1

0

first of all yes it's a warning and not an error, and it's because you're probably using this library https://github.com/cair/pyVNC

and this part (/usr/lib/python3/dist-packages/pyVNC/Client.py:61) is raising a warning:

if event is "Left": button_id = 1 elif event is "Middle": button_id = 2 elif event is "Right": button_id = 4 

As said in the message they should use "==" instead of "is" see this article for more info https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/

One other things is why this is raise while updating your OS, probably because you don't use a virtualenv for your python scripts. So i would suggest you to do so : https://docs.python.org/3/library/venv.html

    You must log in to answer this question.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.