Skip to content

Commit 82501d7

Browse files
committed
stdlib/os: Update method of extending builtin os.
1 parent 01ab7ba commit 82501d7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python-stdlib/os/os/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
# Replace built-in os module.
2-
from uos import *
1+
# Include built-in os module.
2+
import sys
3+
__path = sys.path
4+
try:
5+
sys.path.clear()
6+
from os import *
7+
finally:
8+
sys.path.extend(__path)
39

410
# Provide optional dependencies (which may be installed separately).
511
try:

0 commit comments

Comments
 (0)