Repository: spyder-ide/spyder

Issue:
An error occurs when autocompleting 'subplots' using kite.
## Description
with kite
![err_subplots](https://user-images.githubusercontent.com/22970578/66165469-bee5cb80-e66f-11e9-878b-7f4635f66f83.gif)

### What steps will reproduce the problem?

<!--- You can use Markdown here --->
1. Enable kite
2. Type Below
```python
from matplotlib.pyplot import subplots

fig, ax = sub
```
3. select subplots()


### Traceback
```python-traceback
  File "/home/ok97465/python/spyder/spyder/plugins/completion/kite/client.py", line 112, in perform_request
    response = converter(response)
  File "/home/ok97465/python/spyder/spyder/plugins/completion/kite/providers/document.py", line 221, in process_signature
    for arg in signature['args']:
TypeError: 'NoneType' object is not iterable
```

## Versions

* Spyder version: 4.0.0.dev0 13c208033
* Python version: 3.7.3
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Linux 5.2.11-1-MANJARO

### Dependencies

```
cloudpickle >=0.5.0          :  1.0.0 (OK)
pygments >=2.0               :  2.4.0 (OK)
qtconsole >=4.5.5            :  4.5.5 (OK)
nbconvert >=4.0              :  5.5.0 (OK)
sphinx >=0.6.6               :  2.0.1 (OK)
pylint >=0.25                :  2.3.1 (OK)
psutil >=0.3                 :  5.6.2 (OK)
qtawesome >=0.5.7            :  0.5.7 (OK)
qtpy >=1.5.0                 :  1.5.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
zmq >=17                     :  17.1.2 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
numpydoc >=0.6.0             :  0.9.1 (OK)
spyder_kernels >=1.5.0;<2.0.0:  1.6.0.dev0 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
atomicwrites >=1.2.0         :  1.2.1 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
watchdog                     :  None (OK)
keyring                      :  None (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pympler                      :  None (OK)
sympy >=0.7.3                :  1.4 (OK)
cython >=0.21                :  0.29.8 (OK)
IPython >=4.0                :  7.8.0 (OK)
matplotlib >=2.0.0           :  3.1.1 (OK)
pandas >=0.13.1              :  0.24.2 (OK)
numpy >=1.7                  :  1.16.4 (OK)
scipy >=0.17.0               :  1.2.1 (OK)
pyls >=0.28.2;<0.29.0        :  0.28.3 (OK)
xdg >=0.26                   :  0.26 (OK)
rtree >=0.8.3                :  0.8.3 (OK)
```



Discussion:
@steff456, please take a look at this one. I think we need to check if signature is not None before trying to get its args.

Resolving patch:
diff --git a/spyder/plugins/completion/kite/providers/document.py b/spyder/plugins/completion/kite/providers/document.py
--- a/spyder/plugins/completion/kite/providers/document.py
+++ b/spyder/plugins/completion/kite/providers/document.py
@@ -226,12 +226,13 @@ def process_signature(self, response):
                 if len(signatures) > 0:
                     signature = signatures[0]
                     logger.debug(signature)
-                    for arg in signature['args']:
-                        parameters.append({
-                            'label': arg['name'],
-                            'documentation': ''
-                        })
-                        names.append(arg['name'])
+                    if signature['args'] is not None:
+                        for arg in signature['args']:
+                            parameters.append({
+                                'label': arg['name'],
+                                'documentation': ''
+                            })
+                            names.append(arg['name'])
 
                     func_args = ', '.join(names)
                     call_label = '{0}({1})'.format(call_label, func_args)


Test patch: