]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/test/tf_inherit_check.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / tf_inherit_check.py
CommitLineData
4710c53d 1# Helper script for test_tempfile.py. argv[2] is the number of a file\r
2# descriptor which should _not_ be open. Check this by attempting to\r
3# write to it -- if we succeed, something is wrong.\r
4\r
5import sys\r
6import os\r
7\r
8verbose = (sys.argv[1] == 'v')\r
9try:\r
10 fd = int(sys.argv[2])\r
11\r
12 try:\r
13 os.write(fd, "blat")\r
14 except os.error:\r
15 # Success -- could not write to fd.\r
16 sys.exit(0)\r
17 else:\r
18 if verbose:\r
19 sys.stderr.write("fd %d is open in child" % fd)\r
20 sys.exit(1)\r
21\r
22except StandardError:\r
23 if verbose:\r
24 raise\r
25 sys.exit(1)\r