[Zope-Checkins] CVS: Zope/lib/python/ZODB - lock_file.py:1.3.16.2
Fred L. Drake, Jr.
fdrake@acm.org
Wed, 20 Feb 2002 21:14:58 -0500
Update of /cvs-repository/Zope/lib/python/ZODB
In directory cvs.zope.org:/tmp/cvs-serv24956
Modified Files:
Tag: Zope-2_5-branch
lock_file.py
Log Message:
Split lines after structural colons; this makes it easier to modify things
for debugging purposes.
[Merged from trunk.]
=== Zope/lib/python/ZODB/lock_file.py 1.3.16.1 => 1.3.16.2 ===
def lock_file(file, error=POSException.StorageSystemError):
- try: un=file.fileno()
- except: return # don't care if not a real file
+ try:
+ un=file.fileno()
+ except:
+ return # don't care if not a real file
- try: fcntl.flock(un,lock_file_FLAG)
+ try:
+ fcntl.flock(un,lock_file_FLAG)
except:
raise error, (
"Could not lock the database file. There must be\n"
@@ -37,14 +40,19 @@
try:
from winlock import LockFile
def lock_file(file, error=POSException.StorageSystemError):
- try: un=file.fileno()
- except: return # don't care if not a real file
- try: LockFile(un,0,0,1,0) # just lock the first byte, who cares
+ try:
+ un=file.fileno()
+ except:
+ return # don't care if not a real file
+
+ try:
+ LockFile(un,0,0,1,0) # just lock the first byte, who cares
except:
raise error, (
"Could not lock the database file. There must be\n"
"another process that has opened the file.\n"
"<p>")
except:
- def lock_file(file, error=None): pass
+ def lock_file(file, error=None):
+ pass