From: Guido van Rossum Date: Mon, 12 May 1997 22:15:52 +0000 (+0000) Subject: Finally found a wat to set a file nonblocking that works on Irix, X-Git-Tag: v1.5a2~46 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e351f34c516b7b0f8a1c75b0744347f1f6673a4;p=python Finally found a wat to set a file nonblocking that works on Irix, Solaris and Linux: use os.O_NONBLOCK. --- diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py index c563018131..a5ea1e678f 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: