Fix duplicate import generation

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
syvb 2025-05-22 13:50:43 -07:00 committed by Ashwin Naren
parent 7f0cebd442
commit 9d9fdd2f79
No known key found for this signature in database
GPG key ID: D96D7DE56FBCB6B6
3 changed files with 10 additions and 6 deletions

View file

@ -72,8 +72,9 @@ def main():
for webidl in webidls:
filename = os.path.join(webidls_dir, webidl)
prefix = "Bindings/%sBinding" % webidl[:-len(".webidl")]
module = CGBindingRoot(config, prefix, filename).define()
name = webidl[:-len(".webidl")]
prefix = "Bindings/%sBinding" % name
module = CGBindingRoot(config, prefix, filename, name).define()
if module:
with open(os.path.join(out_dir, prefix + ".rs"), "wb") as f:
f.write(module.encode("utf-8"))