We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
str_to_raw_id()
1 parent 4a23832 commit 810fb54Copy full SHA for 810fb54
src/comfy_script/astutil.py
@@ -24,7 +24,8 @@ def is_xid_continue(s: str) -> bool:
24
25
def str_to_raw_id(s: str) -> str:
26
s = s.lstrip()
27
- assert s != ''
+ if s == '':
28
+ return '_'
29
30
if s.isascii():
31
s = re.sub(r'[^A-Za-z_0-9]', '_', s)
tests/test_astutil.py
@@ -4,6 +4,7 @@
4
import comfy_script.astutil as astutil
5
6
@pytest.mark.parametrize('s, id', [
7
+ ('', '_'),
8
(':<', '_'),
9
(':|', '_'),
10
(':/', '_'),
0 commit comments