Ensure the working directory is unaltered after generating docs

This commit is contained in:
Lonami Exo 2017-09-23 21:02:32 +02:00
parent 40d80f73ee
commit d5ba259d4e

View File

@ -563,5 +563,8 @@ def copy_resources():
if __name__ == '__main__':
os.makedirs('generated', exist_ok=True)
os.chdir('generated')
generate_documentation('../../telethon_generator/scheme.tl')
copy_resources()
try:
generate_documentation('../../telethon_generator/scheme.tl')
copy_resources()
finally:
os.chdir(os.pardir)