[Python-Dev] [Python-checkins] python/dist/src/Lib/test regrtest.py, 1.171, 1.172 test_ioctl.py, 1.2, 1.3

Neal Norwitz nnorwitz at gmail.com
Wed Sep 14 21:01:09 CEST 2005


> Index: test_ioctl.py
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ioctl.py,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -d -r1.2 -r1.3
> --- test_ioctl.py       20 Mar 2003 04:33:16 -0000      1.2
> +++ test_ioctl.py       14 Sep 2005 18:09:41 -0000      1.3
> @@ -16,19 +16,23 @@
> 
>  class IoctlTests(unittest.TestCase):
>      def test_ioctl(self):
> -        pgrp = os.getpgrp()
> +        # If this process has been put into the background, TIOCGPGRP returns
> +        # the session ID instead of the process group id.
> +        ids = (os.getpgrp(), os.getsid(0))
>          tty = open("/dev/tty", "r")
>          r = fcntl.ioctl(tty, termios.TIOCGPGRP, "    ")
> -        self.assertEquals(pgrp, struct.unpack("i", r)[0])
> +        rpgrp = struct.unpack("i", r)[0]
> +        self.assert_(rpgrp in ids, "%s not in %s" % (rpgrp, ids))

With the change to use unsigned ints in pwd and grp modules, should
the struct.unpack() use "I" (capital i) instead of "i"?

n


More information about the Python-Dev mailing list