@@ -8,12 +8,20 @@ def vars(obj):
8
8
def getrecursionlimit ():
9
9
return 100
10
10
11
+ class Warning (Exception ):
12
+ pass
13
+ class RuntimeWarning (Warning ):
14
+ pass
15
+
11
16
12
17
def _setup ():
13
18
import builtins
14
19
15
20
builtins .vars = vars
16
21
builtins .FileNotFoundError = OSError
22
+ builtins .IOError = OSError
23
+ builtins .Warning = Warning
24
+ builtins .RuntimeWarning = RuntimeWarning
17
25
18
26
from micropython import writable_ns
19
27
import sys
@@ -23,10 +31,10 @@ def _setup():
23
31
24
32
PATCHES = {
25
33
str : (
26
- string , ("encode" , "expandtabs" , "isidentifier" , "ljust" , "translate" ),
34
+ string , ("capitalize" , " encode" , "expandtabs" , "isalnum " , "isidentifier" , "ljust" , "translate" ),
27
35
),
28
36
bytes : (
29
- byteslib , ("fromhex" , "hex" ),
37
+ byteslib , ("decode" , " fromhex" , "hex" ),
30
38
),
31
39
set : (
32
40
setlib , ("update" , "union" , "intersection_update" , "intersection" , "difference_update" , "difference" ),
@@ -44,6 +52,8 @@ def _setup():
44
52
# to sys.stdout and friends. So, patch the module namespace directly.
45
53
writable_ns (sys , True )
46
54
sys .getrecursionlimit = getrecursionlimit
55
+ sys .executable = "pycopy-dev"
56
+ sys .warnoptions = []
47
57
writable_ns (sys , False )
48
58
49
59
0 commit comments