Skip to content

Commit 9df5728

Browse files
authored
Merge pull request #87 from thewtex/make-example-directory
BUG: Missing binary Examples folder
2 parents b9fb1a8 + 14a2524 commit 9df5728

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

SoftwareGuide/Examples/ParseCxxExamples.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
import sys
33
import os
4+
import errno
45
import re
56
import shlex
67
import subprocess
@@ -156,6 +157,15 @@ def GetPreambleString(examplefilename):
156157

157158
thisCodeBlocks = ParseOneFile(inputfilename)
158159

160+
try:
161+
path = os.path.dirname(outputfilename)
162+
os.makedirs(path)
163+
except OSError as exc: # Python >2.5
164+
if exc.errno == errno.EEXIST and os.path.isdir(path):
165+
pass
166+
else:
167+
raise
168+
159169
outPtr = open(outputfilename, 'w')
160170
outPtr.write(GetPreambleString(inputfilename))
161171
for cb in thisCodeBlocks:

0 commit comments

Comments
 (0)