Skip to content

Commit 89144bf

Browse files
committed
Merge branch 'main' into emscripten-set-umask-zero
2 parents 595781e + 180b3eb commit 89144bf

File tree

14 files changed

+53
-25
lines changed

14 files changed

+53
-25
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
root = true
22

3-
[*.{py,c,cpp,h,js,rst,md,yml,yaml}]
3+
[*.{py,c,cpp,h,js,rst,md,yml,yaml,gram}]
44
trim_trailing_whitespace = true
55
insert_final_newline = true
66
indent_style = space
77

8-
[*.{py,c,cpp,h}]
8+
[*.{py,c,cpp,h,gram}]
99
indent_size = 4
1010

1111
[*.rst]

Doc/library/importlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ Functions
206206
:exc:`ModuleNotFoundError` is raised when the module being reloaded lacks
207207
a :class:`~importlib.machinery.ModuleSpec`.
208208

209+
.. warning::
210+
This function is not thread-safe. Calling it from multiple threads can result
211+
in unexpected behavior. It's recommended to use the :class:`threading.Lock`
212+
or other synchronization primitives for thread-safe module reloading.
209213

210214
:mod:`importlib.abc` -- Abstract base classes related to import
211215
---------------------------------------------------------------

Lib/test/support/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ def skip_android_selinux(name):
570570
is_wasi = sys.platform == "wasi"
571571

572572
def skip_emscripten_stack_overflow():
573-
return unittest.skipIf(is_emscripten, "Exhausts limited stack on Emscripten")
573+
return unittest.skipIf(is_emscripten, "Exhausts stack on Emscripten")
574574

575575
def skip_wasi_stack_overflow():
576576
return unittest.skipIf(is_wasi, "Exhausts stack on WASI")

Lib/test/test_descr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,7 @@ def __del__(self):
39423942
# it as a leak.
39433943
del C.__del__
39443944

3945-
@unittest.skipIf(support.is_emscripten, "Seems to works in Pyodide?")
3945+
@support.skip_emscripten_stack_overflow()
39463946
@support.skip_wasi_stack_overflow()
39473947
def test_slots_trash(self):
39483948
# Testing slot trash...

Lib/test/test_os.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,11 +1918,9 @@ def test_makedir(self):
19181918
support.is_wasi,
19191919
"WASI's umask is a stub."
19201920
)
1921-
@unittest.skipIf(
1922-
support.is_emscripten,
1923-
"TODO: Fails in buildbot; see #135783"
1924-
)
19251921
def test_mode(self):
1922+
# Note: in some cases, the umask might already be 2 in which case this
1923+
# will pass even if os.umask is actually broken.
19261924
with os_helper.temp_umask(0o002):
19271925
base = os_helper.TESTFN
19281926
parent = os.path.join(base, 'dir1')

Lib/test/test_warnings/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,13 +555,7 @@ def test_warn_explicit_non_ascii_filename(self):
555555
with self.module.catch_warnings(record=True) as w:
556556
self.module.resetwarnings()
557557
self.module.filterwarnings("always", category=UserWarning)
558-
filenames = ["nonascii\xe9\u20ac"]
559-
if not support.is_emscripten:
560-
# JavaScript does not like surrogates.
561-
# Invalid UTF-8 leading byte 0x80 encountered when
562-
# deserializing a UTF-8 string in wasm memory to a JS
563-
# string!
564-
filenames.append("surrogate\udc80")
558+
filenames = ["nonascii\xe9\u20ac", "surrogate\udc80"]
565559
for filename in filenames:
566560
try:
567561
os.fsencode(filename)

Lib/test/test_xml_etree_c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_del_attribute(self):
5858
self.assertEqual(element.attrib, {'A': 'B', 'C': 'D'})
5959

6060
@support.skip_wasi_stack_overflow()
61-
@unittest.skipIf(support.is_emscripten, "segfaults")
61+
@support.skip_emscripten_stack_overflow()
6262
def test_trashcan(self):
6363
# If this test fails, it will most likely die via segfault.
6464
e = root = cET.Element('root')

Lib/traceback.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ class FrameSummary:
287287
of code that was running when the frame was captured.
288288
- :attr:`locals` Either None if locals were not supplied, or a dict
289289
mapping the name to the repr() of the variable.
290+
- :attr:`end_lineno` The last line number of the source code for this frame.
291+
By default, it is set to lineno and indexation starts from 1.
292+
- :attr:`colno` The column number of the source code for this frame.
293+
By default, it is None and indexation starts from 0.
294+
- :attr:`end_colno` The last column number of the source code for this frame.
295+
By default, it is None and indexation starts from 0.
290296
"""
291297

292298
__slots__ = ('filename', 'lineno', 'end_lineno', 'colno', 'end_colno',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:mod:`!_asyncio` is now statically linked for improved performance.

Modules/Setup.stdlib.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
############################################################################
3333
# Modules that should always be present (POSIX and Windows):
3434
@MODULE_ARRAY_TRUE@array arraymodule.c
35-
@MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c
3635
@MODULE__BISECT_TRUE@_bisect _bisectmodule.c
3736
@MODULE__CSV_TRUE@_csv _csv.c
3837
@MODULE__HEAPQ_TRUE@_heapq _heapqmodule.c
@@ -193,3 +192,9 @@
193192
# Limited API template modules; must be built as shared modules.
194193
@MODULE_XXLIMITED_TRUE@xxlimited xxlimited.c
195194
@MODULE_XXLIMITED_35_TRUE@xxlimited_35 xxlimited_35.c
195+
196+
197+
# for performance
198+
*static*
199+
200+
@MODULE__ASYNCIO_TRUE@_asyncio _asynciomodule.c

0 commit comments

Comments
 (0)