AttributeError: 'NoneType' object has no attribute 'format'
### System Info

transformers version: 4.21.3
OS: Windows 10
Python version: 3.10 

### Who can help?

_No response_

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

-  Install one of spaCy's transformer model.
```
$ python -m pip install spacy[cuda-autodetect]
$ python -m spacy download en_core_web_trf
```

- Set `PYTHONOPTIMIZE` to 2 or use `-OO` option.

-  Load spaCy model:

```python
import spacy

spacy.load("en_core_web_trf")
```

- Get error similar to this:

```
File "C:\x\spacy\__init__.py", line 54, in load
  File "C:\x\spacy\util.py", line 432, in load_model
  File "C:\x\spacy\util.py", line 468, in load_model_from_package
  File "C:\x\en_core_web_lg\__init__.py", line 10, in load
  File "C:\x\spacy\util.py", line 649, in load_model_from_init_py
  File "C:\x\spacy\util.py", line 506, in load_model_from_path
  File "C:\x\spacy\util.py", line 554, in load_model_from_config
  File "C:\x\spacy\language.py", line 1788, in from_config
  File "C:\x\spacy\language.py", line 163, in __init__
  File "C:\x\catalogue\__init__.py", line 119, in get_all
  File "C:\x\catalogue\__init__.py", line 134, in get_entry_points
  File "importlib\metadata\__init__.py", line 162, in load
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\x\spacy_transformers\__init__.py", line 1, in <module>
  File "C:\x\spacy_transformers\architectures.py", line 6, in <module>
  File "C:\x\spacy_transformers\layers\__init__.py", line 1, in <module>
  File "C:\x\spacy_transformers\layers\listener.py", line 4, in <module>
  File "C:\x\spacy_transformers\data_classes.py", line 5, in <module>
  File "C:\x\transformers\tokenization_utils.py", line 26, in <module>
  File "C:\x\transformers\tokenization_utils_base.py", line 3646, in <module>
AttributeError: 'NoneType' object has no attribute 'format'
```

This could happen when running the code in a Python interpreter which has optimize level set to 2 and it can't be changed, for exmaple: [calibre](https://calibre-ebook.com).

### Expected behavior

No error.