[BUG #7535] generate.py fix