Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
34ac0dec
Commit
34ac0dec
authored
Oct 05, 2001
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace explicit type() comparisons with isinstance() calls
parent
61e2f3b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/ZODB/FileStorage.py
src/ZODB/FileStorage.py
+5
-5
No files found.
src/ZODB/FileStorage.py
View file @
34ac0dec
...
@@ -186,7 +186,7 @@
...
@@ -186,7 +186,7 @@
# may have a back pointer to a version record or to a non-version
# may have a back pointer to a version record or to a non-version
# record.
# record.
#
#
__version__
=
'$Revision: 1.7
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.7
1
$'
[
11
:
-
2
]
import
struct
,
time
,
os
,
bpthread
,
string
,
base64
,
sys
import
struct
,
time
,
os
,
bpthread
,
string
,
base64
,
sys
from
struct
import
pack
,
unpack
from
struct
import
pack
,
unpack
...
@@ -465,9 +465,8 @@ class FileStorage(BaseStorage.BaseStorage,
...
@@ -465,9 +465,8 @@ class FileStorage(BaseStorage.BaseStorage,
def
commitVersion
(
self
,
src
,
dest
,
transaction
,
abort
=
None
):
def
commitVersion
(
self
,
src
,
dest
,
transaction
,
abort
=
None
):
# We are going to commit by simply storing back pointers.
# We are going to commit by simply storing back pointers.
if
(
not
src
or
if
not
(
src
and
isinstance
(
src
,
StringType
)
type
(
src
)
is
not
StringType
or
type
(
dest
)
is
not
StringType
and
isinstance
(
dest
,
StringType
)):
):
raise
POSException
.
VersionCommitError
(
'Invalid source version'
)
raise
POSException
.
VersionCommitError
(
'Invalid source version'
)
if
src
==
dest
:
if
src
==
dest
:
...
@@ -2012,7 +2011,8 @@ class FileIterator(Iterator):
...
@@ -2012,7 +2011,8 @@ class FileIterator(Iterator):
_ltid
=
z64
_ltid
=
z64
def
__init__
(
self
,
file
):
def
__init__
(
self
,
file
):
if
type
(
file
)
is
type
(
''
):
file
=
open
(
file
,
'rb'
)
if
isinstance
(
file
,
StringType
):
file
=
open
(
file
,
'rb'
)
self
.
_file
=
file
self
.
_file
=
file
if
file
.
read
(
4
)
!=
packed_version
:
raise
FileStorageFormatError
,
name
if
file
.
read
(
4
)
!=
packed_version
:
raise
FileStorageFormatError
,
name
file
.
seek
(
0
,
2
)
file
.
seek
(
0
,
2
)
...
...
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