]> granicus.if.org Git - python/commitdiff
Fix the NDELAY test; avoid outputting binary garbage.
authorGuido van Rossum <guido@python.org>
Fri, 9 May 1997 02:06:05 +0000 (02:06 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 9 May 1997 02:06:05 +0000 (02:06 +0000)
Lib/test/test_fcntl.py

index 4929fbb3fe17a82110813817c5348b3fa65c544c..c563018131671a083abbd9e79ad37a89a0e472d5 100755 (executable)
@@ -12,17 +12,17 @@ filename = '/tmp/delete-me'
 
 # the example from the library docs
 f = open(filename,'w')
-rv = fcntl.fcntl(f.fileno(), FCNTL.O_NDELAY, 1)
+rv = fcntl.fcntl(f.fileno(), FCNTL.F_SETFL, FCNTL.FNDELAY)
 if verbose:
     print 'Status from fnctl with O_NDELAY: ', rv
     
 lockdata = struct.pack('hhllhh', FCNTL.F_WRLCK, 0, 0, 0, 0, 0)
 if verbose:
-    print 'struct.pack: ', lockdata
+    print 'struct.pack: ', `lockdata`
     
 rv = fcntl.fcntl(f.fileno(), FCNTL.F_SETLKW, lockdata)
 if verbose:
-    print 'String from fcntl with F_SETLKW: ', rv
+    print 'String from fcntl with F_SETLKW: ', `rv`
 
 f.close()
 os.unlink(filename)