```python try: if_nametoindex('qweqweq') except Exception as err: print(err.errno) None ``` I think it's a bug because I can not distinguish from any other OS errors precisely (like EPERM vs ENOENT or so) <!-- gh-linked-prs --> ### Linked PRs * gh-140905 * gh-141284 * gh-141285 <!-- /gh-linked-prs -->