Skip to content

Commit c30cef4

Browse files
committed
fixed import of illegal python identifiers (SolidCode#173)
1 parent b1ac306 commit c30cef4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

solid/objects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Dict, Optional, Sequence, Tuple, Union, List
77

88
from .solidpython import IncludedOpenSCADObject, OpenSCADObject
9+
from .helpers import _subbed_keyword
910

1011
PathStr = Union[Path, str]
1112

@@ -794,7 +795,7 @@ def _import_scad(scad: Path) -> Optional[SimpleNamespace]:
794795
if namespace is None:
795796
namespace = SimpleNamespace()
796797
# Add a subspace to namespace named by the file/dir it represents
797-
setattr(namespace, f.stem, subspace)
798+
setattr(namespace, _subbed_keyword(f.stem), subspace)
798799

799800
return namespace
800801

0 commit comments

Comments
 (0)