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
Joshua
zodb
Commits
c17b365c
Commit
c17b365c
authored
Jan 15, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make this compatible with Python 2.1.
parent
6fd5a36a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
src/BTrees/check.py
src/BTrees/check.py
+12
-4
No files found.
src/BTrees/check.py
View file @
c17b365c
...
@@ -32,6 +32,8 @@ addresses and/or object identity (the synthesized bucket has an address
...
@@ -32,6 +32,8 @@ addresses and/or object identity (the synthesized bucket has an address
that doesn't exist in the actual BTree).
that doesn't exist in the actual BTree).
"""
"""
from
types
import
TupleType
try
:
try
:
from
zodb.btrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
,
OOTreeSet
from
zodb.btrees.OOBTree
import
OOBTree
,
OOBucket
,
OOSet
,
OOTreeSet
from
zodb.btrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
from
zodb.btrees.OIBTree
import
OIBTree
,
OIBucket
,
OISet
,
OITreeSet
...
@@ -45,6 +47,12 @@ except ImportError:
...
@@ -45,6 +47,12 @@ except ImportError:
TYPE_UNKNOWN
,
TYPE_BTREE
,
TYPE_BUCKET
=
range
(
3
)
TYPE_UNKNOWN
,
TYPE_BTREE
,
TYPE_BUCKET
=
range
(
3
)
try
:
True
except
NameError
:
True
=
1
False
=
0
_type2kind
=
{
IOBTree
:
(
TYPE_BTREE
,
True
),
_type2kind
=
{
IOBTree
:
(
TYPE_BTREE
,
True
),
IIBTree
:
(
TYPE_BTREE
,
True
),
IIBTree
:
(
TYPE_BTREE
,
True
),
OIBTree
:
(
TYPE_BTREE
,
True
),
OIBTree
:
(
TYPE_BTREE
,
True
),
...
@@ -131,10 +139,10 @@ def crack_btree(t, is_mapping):
...
@@ -131,10 +139,10 @@ def crack_btree(t, is_mapping):
if
state
is
None
:
if
state
is
None
:
return
BTREE_EMPTY
,
[],
[]
return
BTREE_EMPTY
,
[],
[]
assert
isinstance
(
state
,
tupl
e
)
assert
isinstance
(
state
,
TupleTyp
e
)
if
len
(
state
)
==
1
:
if
len
(
state
)
==
1
:
state
=
state
[
0
]
state
=
state
[
0
]
assert
isinstance
(
state
,
tupl
e
)
and
len
(
state
)
==
1
assert
isinstance
(
state
,
TupleTyp
e
)
and
len
(
state
)
==
1
state
=
state
[
0
]
state
=
state
[
0
]
return
BTREE_ONE
,
state
,
None
return
BTREE_ONE
,
state
,
None
...
@@ -183,7 +191,7 @@ def crack_btree(t, is_mapping):
...
@@ -183,7 +191,7 @@ def crack_btree(t, is_mapping):
def
crack_bucket
(
b
,
is_mapping
):
def
crack_bucket
(
b
,
is_mapping
):
state
=
b
.
__getstate__
()
state
=
b
.
__getstate__
()
assert
isinstance
(
state
,
tupl
e
)
assert
isinstance
(
state
,
TupleTyp
e
)
assert
1
<=
len
(
state
)
<=
2
assert
1
<=
len
(
state
)
<=
2
data
=
state
[
0
]
data
=
state
[
0
]
if
not
is_mapping
:
if
not
is_mapping
:
...
@@ -210,7 +218,7 @@ def type_and_adr(obj):
...
@@ -210,7 +218,7 @@ def type_and_adr(obj):
# visit_XYZ() methods once for each node in the tree, in depth-first
# visit_XYZ() methods once for each node in the tree, in depth-first
# left-to-right order.
# left-to-right order.
class
Walker
(
object
)
:
class
Walker
:
def
__init__
(
self
,
obj
):
def
__init__
(
self
,
obj
):
self
.
obj
=
obj
self
.
obj
=
obj
...
...
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