saltudelft / type4py

Type4Py: Deep Similarity Learning-Based Type Inference for Python
Apache License 2.0
61 stars 13 forks source link

Error in variable initialisation #5

Closed gousiosg closed 3 years ago

gousiosg commented 3 years ago

When using the preprocess command with only the -o argument, the code crashes with the following

UnboundLocalError: local variable 'train_files_vars' referenced before assignment

This is because in the following extract

https://github.com/saltudelft/type4py/blob/93828c3d1a3460dc29cace398ca0dcb10ea14daf/type4py/preprocess.py#L302-L319

the train_files_vars variable is only initialised in the if branch

mir-am commented 3 years ago

Thank you @gousiosg for posting the issue. I have fixed the issue and pushed the fix to the main branch.

gousiosg commented 3 years ago

Thanks @mir-am, I can confirm that this works.