+++ /dev/null
-# Helper script for test_tempfile.py. argv[2] is the number of a file\r
-# descriptor which should _not_ be open. Check this by attempting to\r
-# write to it -- if we succeed, something is wrong.\r
-\r
-import sys\r
-import os\r
-\r
-verbose = (sys.argv[1] == 'v')\r
-try:\r
- fd = int(sys.argv[2])\r
-\r
- try:\r
- os.write(fd, "blat")\r
- except os.error:\r
- # Success -- could not write to fd.\r
- sys.exit(0)\r
- else:\r
- if verbose:\r
- sys.stderr.write("fd %d is open in child" % fd)\r
- sys.exit(1)\r
-\r
-except StandardError:\r
- if verbose:\r
- raise\r
- sys.exit(1)\r