Message148460
> +is_valid_fd(int fd)
> [...]
> + dummy_fd = dup(fd);
> + if (dummy_fd < 0)
> + return 0;
> + close(dummy_fd);
>
> Why not use fstat() instead (does Windows have fstat()? And dup()?).
Windows has dup(), but no fstat().
> + @unittest.skipIf(os.name == 'nt', "test needs POSIX semantics")
> + def test_no_stdin(self):
>
> It would maybe be more direct with skipUnless(os.name == 'posix').
Hmm, indeed.
> Finally, it's not that important, but it could maybe be possible to
> factorize the code, i.e. make a helper function that takes a list of
> streams and defines the preexec() function and code to test those
> streams, and then just call:
Ah, indeed perhaps. |
|
Date |
User |
Action |
Args |
2011-11-27 22:14:18 | pitrou | set | recipients:
+ pitrou, loewis, doko, exarkun, amaury.forgeotdarc, belopolsky, benjamin.peterson, stutzbach, naufraghi, Arfrever, petere, neologix |
2011-11-27 22:14:17 | pitrou | link | issue7111 messages |
2011-11-27 22:14:17 | pitrou | create | |
|