Commit d23eb779 authored by Jeremy Hylton's avatar Jeremy Hylton

add a little whitespace

parent 51e2bf1b
...@@ -21,10 +21,13 @@ try: ...@@ -21,10 +21,13 @@ try:
lock_file_FLAG = fcntl.LOCK_EX | fcntl.LOCK_NB lock_file_FLAG = fcntl.LOCK_EX | fcntl.LOCK_NB
def lock_file(file, error=POSException.StorageSystemError): def lock_file(file, error=POSException.StorageSystemError):
try: un=file.fileno() try:
except: return # don't care if not a real file 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: except:
raise error, ( raise error, (
"Could not lock the database file. There must be\n" "Could not lock the database file. There must be\n"
...@@ -36,14 +39,19 @@ except: ...@@ -36,14 +39,19 @@ except:
try: try:
from winlock import LockFile from winlock import LockFile
def lock_file(file, error=POSException.StorageSystemError): def lock_file(file, error=POSException.StorageSystemError):
try: un=file.fileno() try:
except: return # don't care if not a real file un=file.fileno()
try: LockFile(un,0,0,1,0) # just lock the first byte, who cares 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: except:
raise error, ( raise error, (
"Could not lock the database file. There must be\n" "Could not lock the database file. There must be\n"
"another process that has opened the file.\n" "another process that has opened the file.\n"
"<p>") "<p>")
except: except:
def lock_file(file, error=None): pass def lock_file(file, error=None):
pass
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment