Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
2679dd54
Commit
2679dd54
authored
Jan 28, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a little whitespace
parent
dec5912b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
trunk/src/ZODB/lock_file.py
trunk/src/ZODB/lock_file.py
+15
-7
No files found.
trunk/src/ZODB/lock_file.py
View file @
2679dd54
...
...
@@ -21,10 +21,13 @@ try:
lock_file_FLAG
=
fcntl
.
LOCK_EX
|
fcntl
.
LOCK_NB
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
"
...
...
@@ -36,14 +39,19 @@ except:
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment