[Python-checkins] python/dist/src/Lib/test test_fcntl.py,1.26,1.27

perky at users.sourceforge.net perky at users.sourceforge.net
Mon Apr 4 17:21:07 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3285/Lib/test

Modified Files:
	test_fcntl.py 
Log Message:
Fix testcase for 64bit BSD systems: long is 8 bytes for those systems
so there's no need to pad after off_t members.  And a small typo fix.


Index: test_fcntl.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_fcntl.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- test_fcntl.py	18 Aug 2004 15:13:41 -0000	1.26
+++ test_fcntl.py	4 Apr 2005 15:21:04 -0000	1.27
@@ -24,7 +24,13 @@
                     'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5', 'freebsd6',
                     'bsdos2', 'bsdos3', 'bsdos4',
                     'openbsd', 'openbsd2', 'openbsd3'):
-    lockdata = struct.pack('lxxxxlxxxxlhh', 0, 0, 0, fcntl.F_WRLCK, 0)
+    if struct.calcsize('l') == 8:
+        off_t = 'l'
+        pid_t = 'i'
+    else:
+        off_t = 'lxxxx'
+        pid_t = 'l'
+    lockdata = struct.pack(off_t+off_t+pid_t+'hh', 0, 0, 0, fcntl.F_WRLCK, 0)
 elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']:
     lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
 elif sys.platform in ['os2emx']:
@@ -39,7 +45,7 @@
 f = open(filename, 'w')
 rv = fcntl.fcntl(f.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
 if verbose:
-    print 'Status from fnctl with O_NONBLOCK: ', rv
+    print 'Status from fcntl with O_NONBLOCK: ', rv
 
 if sys.platform not in ['os2emx']:
     rv = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW, lockdata)



More information about the Python-checkins mailing list