Skip to content

Commit dbd66ea

Browse files
committed
scad import was reading scad file modules twice. Only do it once now
1 parent f71ccd9 commit dbd66ea

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎solid/objects.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,11 @@ def use(scad_file_path, use_not_include=True, dest_namespace_dict=None):
631631
'''
632632
# These functions in solidpython are used here and only here; don't pollute
633633
# the global namespace with them
634-
from .solidpython import extract_callable_signatures
634+
from .solidpython import parse_scad_callables
635635
from .solidpython import new_openscad_class_str
636636
from .solidpython import calling_module
637637

638+
contents = None
638639
try:
639640
with open(scad_file_path) as module:
640641
contents = module.read()
@@ -645,7 +646,7 @@ def use(scad_file_path, use_not_include=True, dest_namespace_dict=None):
645646
# Once we have a list of all callables and arguments, dynamically
646647
# add OpenSCADObject subclasses for all callables to the calling module's
647648
# namespace.
648-
symbols_dicts = extract_callable_signatures(scad_file_path)
649+
symbols_dicts = parse_scad_callables(contents)
649650

650651
for sd in symbols_dicts:
651652
class_str = new_openscad_class_str(sd['name'], sd['args'], sd['kwargs'],

0 commit comments

Comments
 (0)