Skip to content

Commit

Permalink
Remove hard reference to editor in pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
andfoy committed Aug 31, 2021
1 parent 7587e1c commit 228f1c2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions spyder/plugins/pylint/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from qtpy.QtCore import Qt, Signal, Slot

# Local imports
from spyder.api.exceptions import SpyderAPIError
from spyder.api.plugins import Plugins, SpyderDockablePlugin
from spyder.api.plugin_registration.decorators import (
on_plugin_available, on_plugin_teardown)
Expand Down Expand Up @@ -180,9 +181,13 @@ def _set_filename(self):
"""
Set filename without code analysis.
"""
editor = self.get_plugin(Plugins.Editor)
if editor:
self.get_widget().set_filename(editor.get_current_filename())
try:
editor = self.get_plugin(Plugins.Editor)
if editor:
self.get_widget().set_filename(editor.get_current_filename())
except SpyderAPIError:
# Editor was deleted
pass

# --- Public API
# ------------------------------------------------------------------------
Expand Down

0 comments on commit 228f1c2

Please sign in to comment.