From 0e351f34c516b7b0f8a1c75b0744347f1f6673a4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 12 May 1997 22:15:52 +0000 Subject: Finally found a wat to set a file nonblocking that works on Irix, Solaris and Linux: use os.O_NONBLOCK. --- Lib/test/test_fcntl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py index c563018..a5ea1e6 100755 --- a/Lib/test/test_fcntl.py +++ b/Lib/test/test_fcntl.py @@ -12,9 +12,9 @@ filename = '/tmp/delete-me' # the example from the library docs f = open(filename,'w') -rv = fcntl.fcntl(f.fileno(), FCNTL.F_SETFL, FCNTL.FNDELAY) +rv = fcntl.fcntl(f.fileno(), FCNTL.F_SETFL, os.O_NONBLOCK) if verbose: - print 'Status from fnctl with O_NDELAY: ', rv + print 'Status from fnctl with O_NONBLOCK: ', rv lockdata = struct.pack('hhllhh', FCNTL.F_WRLCK, 0, 0, 0, 0, 0) if verbose: -- cgit v0.12