Repository: spyder-ide/spyder

Issue:
TypeError when disconnecting sig_display_object_info signal
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

1. Start up Spyder
2. Start working on a project and then leave your computer for some time in idle mode.
3. After returning back, resume your work.
4. Error popped up in Linux machine.

### Traceback
```python-traceback
  File "/home/shivendra/anaconda3/lib/python3.7/site-packages/spyder/plugins/editor/widgets/editor.py", line 1068, in display_help
    editor.sig_display_object_info.disconnect(self.display_help)
TypeError: disconnect() failed between 'sig_display_object_info' and 'display_help'
```

## Versions

* Spyder version: 4.0.0 
* Python version: 3.7.4
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Linux 5.3.0-24-generic

### Dependencies

```
cloudpickle >=0.5.0          :  1.2.2 (OK)
pygments >=2.0               :  2.5.2 (OK)
qtconsole >=4.6.0            :  4.6.0 (OK)
nbconvert >=4.0              :  5.6.1 (OK)
sphinx >=0.6.6               :  2.2.2 (OK)
pylint >=0.25                :  2.4.3 (OK)
psutil >=0.3                 :  5.6.7 (OK)
qtawesome >=0.5.7            :  0.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
zmq >=17                     :  18.1.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
numpydoc >=0.6.0             :  0.9.1 (OK)
spyder_kernels >=1.8.1;<2.0.0:  1.8.1 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
atomicwrites >=1.2.0         :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
intervaltree                 :  None (OK)
watchdog                     :  None (OK)
keyring                      :  None (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pympler                      :  None (OK)
sympy >=0.7.3                :  None (NOK)
cython >=0.21                :  None (NOK)
IPython >=4.0                :  7.10.1 (OK)
matplotlib >=2.0.0           :  3.1.1 (OK)
pandas >=0.13.1              :  0.25.3 (OK)
numpy >=1.7                  :  1.17.4 (OK)
scipy >=0.17.0               :  1.3.1 (OK)
pyls >=0.31.2;<0.32.0        :  0.31.2 (OK)
xdg >=0.26                   :  0.26 (OK)
rtree >=0.8.3                :  0.8.3 (OK)
```



Discussion:
@shivendra90, thanks for reporting.

@dalthviz, please enclose this line

https://github.com/spyder-ide/spyder/blob/e6a08081ec3f38d7a4b5af071b8534562ba452c0/spyder/plugins/editor/widgets/editor.py#L1068

in a `try/except TypeError` to avoid this error.

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/editor.py b/spyder/plugins/editor/widgets/editor.py
--- a/spyder/plugins/editor/widgets/editor.py
+++ b/spyder/plugins/editor/widgets/editor.py
@@ -1065,7 +1065,12 @@ def display_help(self, help_text, clicked):
         else:
             name = editor.get_current_word()
 
-        editor.sig_display_object_info.disconnect(self.display_help)
+        try:
+            editor.sig_display_object_info.disconnect(self.display_help)
+        except TypeError:
+            # Needed to prevent an error after some time in idle.
+            # See spyder-ide/spyder#11228
+            pass
         self.help.switch_to_editor_source()
         self.send_to_help(name, help_text, force=True)
 


Test patch: