Yelp / parcelgen

Helpful tool to make data objects easier for Android
Other
65 stars 35 forks source link

fix UnboundLocalError: local variable 'targetFile' referenced before … #59

Closed alanhamlett closed 5 years ago

alanhamlett commented 6 years ago

…assignment

alanhamlett commented 6 years ago

Any eta on when this will be merged?

alanhamlett commented 5 years ago

Any feedback on this PR?

Update: Sorry about the duplicate comments, GitHub kept saying my comment failed to post.

jbrick commented 5 years ago

Hey! Sorry for the super late reply, this isn't a project we put a ton of active maintenance into. I can look at merging this,

Can you resolve the merge conflicts, and add a little description about the bug, what causes the exception to occur?

alanhamlett commented 5 years ago

Sure, just fixed the merge conflicts. The bug is fixed with https://github.com/Yelp/parcelgen/pull/59/commits/a1907b6e9069e0074c48f66c8f82bd5b8e42cd4b. The cause of the bug was using targetFile without first defining it, which happened because targetFile is only defined when if os.path.isdir(output) evaluates to True but targetFile is always used regardless of that if condition.