Skip to content

Commit

Permalink
fix NameError
Browse files Browse the repository at this point in the history
Traceback (most recent call last):
100
  File "/home/runner/work/spyder/spyder/spyder/plugins/completion/languageserver/plugin.py", line 400, in <lambda>
101
    timer.timeout.connect(lambda ls=self: ls.check_heartbeat(language))
102
NameError: free variable 'language' referenced before assignment in enclosing scope
  • Loading branch information
Quentin Peter committed Jul 25, 2020
1 parent 68f57ef commit 6d3b7b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spyder/plugins/completion/languageserver/plugin.py
Expand Up @@ -397,7 +397,9 @@ def start_client(self, language):
timer = QTimer(self)
self.clients_hearbeat[language] = timer
timer.setInterval(self.TIME_HEARTBEAT)
timer.timeout.connect(lambda ls=self: ls.check_heartbeat(language))
timer.timeout.connect(
lambda ls=self, language=language: ls.check_heartbeat(
language))
timer.start()

if language_client['status'] == self.STOPPED:
Expand Down

0 comments on commit 6d3b7b2

Please sign in to comment.