Skip to content

Commit ec7b111

Browse files
committed
Omit modules from generated imports
1 parent 485ea48 commit ec7b111

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

robotpy_build/tool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pprint
99
import subprocess
1010
import sys
11+
import types
1112
import re
1213
from urllib.request import Request, urlopen
1314
from urllib.error import HTTPError
@@ -233,6 +234,9 @@ def run(self, args):
233234
# TODO: could probably generate this from parsed code, but seems hard
234235
ctx = {}
235236
exec(f"from {compiled} import *", {}, ctx)
237+
for k in list(ctx.keys()):
238+
if isinstance(ctx[k], types.ModuleType):
239+
del ctx[k]
236240

237241
relimport = self._rel(args.base, compiled)
238242

0 commit comments

Comments
 (0)