1# test errno's and uerrno module
2
3try:
4    import uerrno
5except ImportError:
6    print("SKIP")
7    raise SystemExit
8
9# check that constants exist and are integers
10print(type(uerrno.EIO))
11
12# check that errors are rendered in a nice way
13msg = str(OSError(uerrno.EIO))
14print(msg[:7], msg[-5:])
15
16# check that unknown errno is still rendered
17print(str(OSError(9999)))
18
19# this tests a failed constant lookup in errno
20errno = uerrno
21print(errno.__name__)
22