File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 10
10
11
11
import os
12
12
13
- try :
14
- import tomllib
15
- except ImportError :
16
- import toml as tomllib
17
-
18
13
19
14
class Enum :
20
15
"""
@@ -82,9 +77,16 @@ def unlock(self):
82
77
83
78
84
79
def load_settings_toml ():
85
- """Load values from settings.toml into os.environ, so that os.getenv returns them."""
80
+ """Load values from settings.toml into os.environ, so that os.getenv returns them.
81
+ Note: This does not work in MicroPython because of the tomllib module not being available.
82
+ """
83
+ try :
84
+ import tomllib
85
+ except ImportError :
86
+ import toml as tomllib
87
+
86
88
if not os .path .isfile ("settings.toml" ):
87
- raise FileNotFoundError ("settings.toml not cound in current directory." )
89
+ raise FileNotFoundError ("settings.toml not found in current directory." )
88
90
89
91
print ("settings.toml found. Updating environment variables:" )
90
92
with open ("settings.toml" , "rb" ) as toml_file :
You can’t perform that action at this time.
0 commit comments