Skip to content

Commit 2c4e29e

Browse files
committed
Merge branch 'main' of https://github.com/python/cpython into main
2 parents 500b0f4 + e295d86 commit 2c4e29e

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

Doc/howto/urllib2.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66

77
:Author: `Michael Foord <https://agileabstractions.com/>`_
88

9-
.. note::
10-
11-
There is a French translation of an earlier revision of this
12-
HOWTO, available at `urllib2 - Le Manuel manquant
13-
<https://web.archive.org/web/20200910051922/http://www.voidspace.org.uk/python/articles/urllib2_francais.shtml>`_.
14-
15-
169

1710
Introduction
1811
============

Include/cpython/longintrepr.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ _PyLong_FromDigits(int negative, Py_ssize_t digit_count, digit *digits);
104104
#define _PyLong_SIGN_MASK 3
105105
#define _PyLong_NON_SIZE_BITS 3
106106

107+
107108
static inline int
108109
_PyLong_IsCompact(const PyLongObject* op) {
109-
assert(PyLong_Check(op));
110+
assert(PyType_HasFeature((op)->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS));
110111
return op->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS);
111112
}
112113

@@ -115,7 +116,7 @@ _PyLong_IsCompact(const PyLongObject* op) {
115116
static inline Py_ssize_t
116117
_PyLong_CompactValue(const PyLongObject *op)
117118
{
118-
assert(PyLong_Check(op));
119+
assert(PyType_HasFeature((op)->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS));
119120
assert(PyUnstable_Long_IsCompact(op));
120121
Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
121122
return sign * (Py_ssize_t)op->long_value.ob_digit[0];

0 commit comments

Comments
 (0)