Skip to content

Commit 8380c7b

Browse files
committed
string: Convert string module to package and import templatelib.
Convert the existing `string` module into a package with `__init__.py` and `templatelib.py`. This is needed to support t-strings (if they are enabled) because there is a built-in `string.templatelib` module with built-in `Template` and `Interpolation` classes. Signed-off-by: Damien George <damien@micropython.org>
1 parent 41927d7 commit 8380c7b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

python-stdlib/string/manifest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
metadata(version="0.1.1")
1+
metadata(version="0.2.0")
22

3-
module("string.py")
3+
package("string")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Import built-in t-string classes if they exist.
2+
try:
3+
from ustring.templatelib import *
4+
except:
5+
pass

0 commit comments

Comments
 (0)