Skip to content

Commit

Permalink
fix(bindgen): use writeIfOverrideNotPresent for python function modules
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Aug 21, 2023
1 parent 3478c4a commit f7fcf55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/bindgen/python/emscripten/emscripten-function-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import functionModuleArgs from '../function-module-args.js'
import functionModuleReturnType from '../function-module-return-type.js'
import functionModuleDocstring from '../function-module-docstring.js'
import interfaceJsonTypeToInterfaceType from '../../interface-json-type-to-interface-type.js'
import writeIfOverrideNotPresent from '../../write-if-override-not-present.js'

function emscriptenFunctionModule(interfaceJson, pypackage, modulePath) {
const functionName = snakeCase(interfaceJson.name)
Expand Down Expand Up @@ -99,7 +100,7 @@ ${addKwargs}
return output_list[0]
return tuple(output_list)
`
fs.writeFileSync(modulePath, moduleContent)
writeIfOverrideNotPresent(modulePath, moduleContent, '#')
}

export default emscriptenFunctionModule
3 changes: 2 additions & 1 deletion src/bindgen/python/wasi/wasi-function-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import functionModuleDocstring from '../function-module-docstring.js'
import functionModuleArgs from '../function-module-args.js'
import interfaceJsonTypeToInterfaceType from '../../interface-json-type-to-interface-type.js'
import interfaceJsonTypeToPythonType from '../interface-json-type-to-python-type.js'
import writeIfOverrideNotPresent from '../../write-if-override-not-present.js'

function wasiFunctionModule(interfaceJson, pypackage, modulePath) {
const functionName = snakeCase(interfaceJson.name)
Expand Down Expand Up @@ -228,7 +229,7 @@ ${args}
${postOutput}
`
fs.writeFileSync(modulePath, moduleContent)
writeIfOverrideNotPresent(modulePath, moduleContent, '#')
}

export default wasiFunctionModule

0 comments on commit f7fcf55

Please sign in to comment.