Fix flaky Python generator
The existing code checked if a directory existed and if it did, it would not attempt to create it. However, this proved to be flaky on Mac and Linux. The check would frequently report the directory as not existing, but the attempt to create the directory would cause an exception.
Showing with 10 additions and 10 deletions