[Python-checkins] CVS: python/dist/src/Lib/lib-old lockfile.py,1.1,1.2

Fred L. Drake fdrake@users.sourceforge.net
Thu, 10 May 2001 08:33:33 -0700


Update of /cvsroot/python/python/dist/src/Lib/lib-old
In directory usw-pr-cvs1:/tmp/cvs-serv20268/lib-old

Modified Files:
	lockfile.py 
Log Message:

Remove all remaining uses of the FCNTL module from the standard library.


Index: lockfile.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/lib-old/lockfile.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** lockfile.py	1994/05/03 14:46:18	1.1
--- lockfile.py	2001/05/10 15:33:31	1.2
***************
*** 1,15 ****
! import struct, fcntl, FCNTL
  
  def writelock(f):
! 	_lock(f, FCNTL.F_WRLCK)
  
  def readlock(f):
! 	_lock(f, FCNTL.F_RDLCK)
  
  def unlock(f):
! 	_lock(f, FCNTL.F_UNLCK)
  
  def _lock(f, op):
! 	dummy = fcntl.fcntl(f.fileno(), FCNTL.F_SETLKW,
  			    struct.pack('2h8l', op,
  					0, 0, 0, 0, 0, 0, 0, 0, 0))
--- 1,15 ----
! import struct, fcntl
  
  def writelock(f):
! 	_lock(f, fcntl.F_WRLCK)
  
  def readlock(f):
! 	_lock(f, fcntl.F_RDLCK)
  
  def unlock(f):
! 	_lock(f, fcntl.F_UNLCK)
  
  def _lock(f, op):
! 	dummy = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW,
  			    struct.pack('2h8l', op,
  					0, 0, 0, 0, 0, 0, 0, 0, 0))