Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
BTrees
Commits
3d07a663
Commit
3d07a663
authored
Oct 08, 2014
by
Fred Drake
Browse files
Options
Browse Files
Download
Plain Diff
update from master
parents
88c1dce0
a8dae6c3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
7 deletions
+25
-7
BTrees/intkeymacros.h
BTrees/intkeymacros.h
+4
-3
BTrees/intvaluemacros.h
BTrees/intvaluemacros.h
+2
-1
BTrees/tests/testBTrees.py
BTrees/tests/testBTrees.py
+10
-3
BTrees/tests/test_IIBTree.py
BTrees/tests/test_IIBTree.py
+2
-0
CHANGES.rst
CHANGES.rst
+7
-0
No files found.
BTrees/intkeymacros.h
View file @
3d07a663
...
...
@@ -19,9 +19,10 @@
#define KEY_CHECK INT_CHECK
#define COPY_KEY_TO_OBJECT(O, K) O=INT_FROM_LONG(K)
#define COPY_KEY_FROM_ARG(TARGET, ARG, STATUS) \
if (INT_CHECK(ARG)) { \
long vcopy = INT_AS_LONG(ARG); \
if ((int)vcopy != vcopy) { \
if (INT_CHECK(ARG)) { \
long vcopy = INT_AS_LONG(ARG); \
if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \
else if ((int)vcopy != vcopy) { \
PyErr_SetString(PyExc_TypeError, "integer out of range"); \
(STATUS)=0; (TARGET)=0; \
} \
...
...
BTrees/intvaluemacros.h
View file @
3d07a663
...
...
@@ -23,7 +23,8 @@
#define COPY_VALUE_FROM_ARG(TARGET, ARG, STATUS) \
if (INT_CHECK(ARG)) { \
long vcopy = INT_AS_LONG(ARG); \
if ((int)vcopy != vcopy) { \
if (PyErr_Occurred()) { (STATUS)=0; (TARGET)=0; } \
else if ((int)vcopy != vcopy) { \
PyErr_SetString(PyExc_TypeError, "integer out of range"); \
(STATUS)=0; (TARGET)=0; \
} \
...
...
BTrees/tests/testBTrees.py
View file @
3d07a663
...
...
@@ -11,8 +11,11 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import
sys
import
unittest
python3
=
sys
.
version_info
>=
(
3
,
)
from
BTrees.tests.common
import
permutations
...
...
@@ -450,9 +453,13 @@ class FamilyTest(unittest.TestCase):
# this next bit illustrates an, um, "interesting feature". If
# the characteristics change to match the 64 bit version, please
# feel free to change.
big
=
BTrees
.
family32
.
maxint
+
1
self
.
assertRaises
(
TypeError
,
s
.
insert
,
big
)
self
.
assertRaises
(
TypeError
,
s
.
insert
,
BTrees
.
family32
.
minint
-
1
)
try
:
s
.
insert
(
BTrees
.
family32
.
maxint
+
1
)
except
(
TypeError
,
OverflowError
):
pass
else
:
self
.
assert_
(
False
)
try
:
s
.
insert
(
BTrees
.
family32
.
minint
-
1
)
except
(
TypeError
,
OverflowError
):
pass
else
:
self
.
assert_
(
False
)
self
.
check_pickling
(
BTrees
.
family32
)
def
test64
(
self
):
...
...
BTrees/tests/test_IIBTree.py
View file @
3d07a663
...
...
@@ -113,6 +113,8 @@ class _IIBTreeTestBase(BTreeTests):
i
=
int
(
i
)
try
:
b
[
i
]
=
0
except
OverflowError
:
self
.
assertRaises
(
OverflowError
,
b
.
__setitem__
,
0
,
i
)
except
TypeError
:
self
.
assertRaises
(
TypeError
,
b
.
__setitem__
,
0
,
i
)
else
:
...
...
CHANGES.rst
View file @
3d07a663
...
...
@@ -4,6 +4,13 @@
- BTree subclasses can define max_leaf_size or max_internal_size to
control maximum sizes for Bucket/Set and BTree/TreeSet nodes.
- Fixed: integer overflow on 32-bit machines wasn't detected correctly
under Python 3.
4.0.9 (unreleased)
------------------
- Added support for Python 3.4.
- Update pure-Python and C trees / sets to accept explicit None to indicate
...
...
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