Skip to content

Commit bb82e61

Browse files
committed
2 parents 88f067c + d8fa40b commit bb82e61

File tree

11 files changed

+56
-29
lines changed

11 files changed

+56
-29
lines changed

Include/Python.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#include "pybuffer.h"
6969
#include "pystats.h"
7070
#include "pyatomic.h"
71-
#include "lock.h"
71+
#include "pylock.h"
7272
#include "critical_section.h"
7373
#include "object.h"
7474
#include "refcount.h"
File renamed without changes.

Include/internal/pycore_lock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ extern "C" {
1313
# error "this header requires Py_BUILD_CORE define"
1414
#endif
1515

16-
//_Py_UNLOCKED is defined as 0 and _Py_LOCKED as 1 in Include/cpython/lock.h
16+
//_Py_UNLOCKED is defined as 0 and _Py_LOCKED as 1 in Include/cpython/pylock.h
1717
#define _Py_HAS_PARKED 2
1818
#define _Py_ONCE_INITIALIZED 4
1919

Include/lock.h renamed to Include/pylock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern "C" {
66

77
#ifndef Py_LIMITED_API
88
# define Py_CPYTHON_LOCK_H
9-
# include "cpython/lock.h"
9+
# include "cpython/pylock.h"
1010
# undef Py_CPYTHON_LOCK_H
1111
#endif
1212

Makefile.pre.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ PYTHON_HEADERS= \
11871187
$(srcdir)/Include/intrcheck.h \
11881188
$(srcdir)/Include/iterobject.h \
11891189
$(srcdir)/Include/listobject.h \
1190-
$(srcdir)/Include/lock.h \
1190+
$(srcdir)/Include/pylock.h \
11911191
$(srcdir)/Include/longobject.h \
11921192
$(srcdir)/Include/marshal.h \
11931193
$(srcdir)/Include/memoryobject.h \
@@ -1264,7 +1264,7 @@ PYTHON_HEADERS= \
12641264
$(srcdir)/Include/cpython/import.h \
12651265
$(srcdir)/Include/cpython/initconfig.h \
12661266
$(srcdir)/Include/cpython/listobject.h \
1267-
$(srcdir)/Include/cpython/lock.h \
1267+
$(srcdir)/Include/cpython/pylock.h \
12681268
$(srcdir)/Include/cpython/longintrepr.h \
12691269
$(srcdir)/Include/cpython/longobject.h \
12701270
$(srcdir)/Include/cpython/memoryobject.h \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rename ``lock.h`` to ``pylock.h`` to avoid potential include conflicts.

Modules/_io/bytesio.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,56 +270,60 @@ bytesio_get_closed(PyObject *op, void *Py_UNUSED(closure))
270270
}
271271

272272
/*[clinic input]
273+
@critical_section
273274
_io.BytesIO.readable
274275
275276
Returns True if the IO object can be read.
276277
[clinic start generated code]*/
277278

278279
static PyObject *
279280
_io_BytesIO_readable_impl(bytesio *self)
280-
/*[clinic end generated code: output=4e93822ad5b62263 input=96c5d0cccfb29f5c]*/
281+
/*[clinic end generated code: output=4e93822ad5b62263 input=ab7816facef48bfd]*/
281282
{
282283
CHECK_CLOSED(self);
283284
Py_RETURN_TRUE;
284285
}
285286

286287
/*[clinic input]
288+
@critical_section
287289
_io.BytesIO.writable
288290
289291
Returns True if the IO object can be written.
290292
[clinic start generated code]*/
291293

292294
static PyObject *
293295
_io_BytesIO_writable_impl(bytesio *self)
294-
/*[clinic end generated code: output=64ff6a254b1150b8 input=700eed808277560a]*/
296+
/*[clinic end generated code: output=64ff6a254b1150b8 input=4f35d49d26dab024]*/
295297
{
296298
CHECK_CLOSED(self);
297299
Py_RETURN_TRUE;
298300
}
299301

300302
/*[clinic input]
303+
@critical_section
301304
_io.BytesIO.seekable
302305
303306
Returns True if the IO object can be seeked.
304307
[clinic start generated code]*/
305308

306309
static PyObject *
307310
_io_BytesIO_seekable_impl(bytesio *self)
308-
/*[clinic end generated code: output=6b417f46dcc09b56 input=9421f65627a344dd]*/
311+
/*[clinic end generated code: output=6b417f46dcc09b56 input=9cc78d15aa1deaa3]*/
309312
{
310313
CHECK_CLOSED(self);
311314
Py_RETURN_TRUE;
312315
}
313316

314317
/*[clinic input]
318+
@critical_section
315319
_io.BytesIO.flush
316320
317321
Does nothing.
318322
[clinic start generated code]*/
319323

320324
static PyObject *
321325
_io_BytesIO_flush_impl(bytesio *self)
322-
/*[clinic end generated code: output=187e3d781ca134a0 input=561ea490be4581a7]*/
326+
/*[clinic end generated code: output=187e3d781ca134a0 input=c60842743910b381]*/
323327
{
324328
CHECK_CLOSED(self);
325329
Py_RETURN_NONE;
@@ -385,6 +389,7 @@ _io_BytesIO_getvalue_impl(bytesio *self)
385389
}
386390

387391
/*[clinic input]
392+
@critical_section
388393
_io.BytesIO.isatty
389394
390395
Always returns False.
@@ -394,7 +399,7 @@ BytesIO objects are not connected to a TTY-like device.
394399

395400
static PyObject *
396401
_io_BytesIO_isatty_impl(bytesio *self)
397-
/*[clinic end generated code: output=df67712e669f6c8f input=6f97f0985d13f827]*/
402+
/*[clinic end generated code: output=df67712e669f6c8f input=50487b74dc5ae8a9]*/
398403
{
399404
CHECK_CLOSED(self);
400405
Py_RETURN_FALSE;

Modules/_io/clinic/bytesio.c.h

Lines changed: 36 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PCbuild/pythoncore.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
<ClInclude Include="..\Include\cpython\import.h" />
166166
<ClInclude Include="..\Include\cpython\initconfig.h" />
167167
<ClInclude Include="..\Include\cpython\listobject.h" />
168-
<ClInclude Include="..\Include\cpython\lock.h" />
168+
<ClInclude Include="..\Include\cpython\pylock.h" />
169169
<ClInclude Include="..\Include\cpython\longintrepr.h" />
170170
<ClInclude Include="..\Include\cpython\longobject.h" />
171171
<ClInclude Include="..\Include\cpython\memoryobject.h" />
@@ -332,7 +332,7 @@
332332
<ClInclude Include="..\Include\intrcheck.h" />
333333
<ClInclude Include="..\Include\iterobject.h" />
334334
<ClInclude Include="..\Include\listobject.h" />
335-
<ClInclude Include="..\Include\lock.h" />
335+
<ClInclude Include="..\Include\pylock.h" />
336336
<ClInclude Include="..\Include\longobject.h" />
337337
<ClInclude Include="..\Include\marshal.h" />
338338
<ClInclude Include="..\Include\memoryobject.h" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
<ClInclude Include="..\Include\listobject.h">
121121
<Filter>Include</Filter>
122122
</ClInclude>
123-
<ClInclude Include="..\Include\lock.h">
123+
<ClInclude Include="..\Include\pylock.h">
124124
<Filter>Include</Filter>
125125
</ClInclude>
126126
<ClInclude Include="..\Include\longobject.h">
@@ -414,7 +414,7 @@
414414
<ClInclude Include="..\Include\cpython\listobject.h">
415415
<Filter>Include\cpython</Filter>
416416
</ClInclude>
417-
<ClInclude Include="..\Include\cpython\lock.h">
417+
<ClInclude Include="..\Include\cpython\pylock.h">
418418
<Filter>Include</Filter>
419419
</ClInclude>
420420
<ClInclude Include="..\Include\cpython\longintrepr.h">

0 commit comments

Comments
 (0)