### Summary

When the. in my case Python, script --host [inventory_host] raises an error it's doesn't catch on exception treatment as it is don on --list

I already made a fix and will create a PR to fix it.

### Issue Type

Bug Report

### Component Name

lib/ansible/plugins/inventory/script.py

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.10]
  config file = None
  configured module search path = ['/home/rundeck/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rundeck/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/rundeck/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rundeck/.local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
Empty
```


### OS / Environment

NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

### Steps to Reproduce

- hosts: all
  gather_facts: false
  tasks:
   - win_ping:

### Expected Results

When the Inventory script ends with status code different than 0, the stderr must be printed as an Warning on the playbook execution

```
ansible-playbook [core 2.13.10]
  config file = None
  configured module search path = ['/home/rundeck/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rundeck/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/rundeck/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rundeck/.local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /home/rundeck/server/data/ansible/inventory.py as it did not pass its verify_file() method
auto declined parsing /home/rundeck/server/data/ansible/inventory.py as it did not pass its verify_file() method
toml declined parsing /home/rundeck/server/data/ansible/inventory.py as it did not pass its verify_file() method
```
**[WARNING]:  * Failed to parse /home/rundeck/server/data/ansible/inventory.py with script plugin: Inventory script (/home/rundeck/server/data/ansible/inventory.py) had an execution error: Error
while retrieving password from Password Safe**
```
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/plu

```

### Actual Results

```console
ansible-playbook [core 2.13.10]
  config file = None
  configured module search path = ['/home/rundeck/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rundeck/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/rundeck/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rundeck/.local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /home/rundeck/server/data/ansible/intel as it did not pass its verify_file() method
auto declined parsing /home/rundeck/server/data/ansible/intel as it did not pass its verify_file() method
toml declined parsing /home/rundeck/server/data/ansible/intel as it did not pass its verify_file() method
[WARNING]:  * Failed to parse /home/rundeck/server/data/ansible/intel with script plugin: Invalid data from file, expected dictionary and got:  None
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/plugins/inventory/script.py", line 149, in parse
    raise AnsibleParserError(to_native(e))
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
    name: script
    version_added: "2.4"
    short_description: Executes an inventory script that returns JSON
    options:
      always_show_stderr:
        description: Toggle display of stderr even when script was successful
        version_added: "2.5.1"
        default: True
        type: boolean
        ini:
           - section: inventory_plugin_script
             key: always_show_stderr
        env:
           - name: ANSIBLE_INVENTORY_PLUGIN_SCRIPT_STDERR
    description:
        - The source provided must be an executable that returns Ansible inventory JSON
        - The source must accept C(--list) and C(--host <hostname>) as arguments.
          C(--host) will only be used if no C(_meta) key is present.
          This is a performance optimization as the script would be called per host otherwise.
    notes:
        - Enabled in configuration by default.
        - The plugin does not cache results because external inventory scripts are responsible for their own caching.
'''
import os
import subprocess