|
@@ -1,11 +1,19 @@
|
|
|
import os
|
|
import os
|
|
|
|
|
+import sys
|
|
|
|
|
|
|
|
border = '// ----------------------------------------------------------------------------'
|
|
border = '// ----------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
|
|
+PythonVersion = sys.version_info[0];
|
|
|
|
|
+
|
|
|
with open('httplib.h') as f:
|
|
with open('httplib.h') as f:
|
|
|
lines = f.readlines()
|
|
lines = f.readlines()
|
|
|
inImplementation = False
|
|
inImplementation = False
|
|
|
- os.makedirs('out', exist_ok=True)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if PythonVersion < 3:
|
|
|
|
|
+ os.makedirs('out')
|
|
|
|
|
+ else:
|
|
|
|
|
+ os.makedirs('out', exist_ok=True)
|
|
|
|
|
+
|
|
|
with open('out/httplib.h', 'w') as fh:
|
|
with open('out/httplib.h', 'w') as fh:
|
|
|
with open('out/httplib.cc', 'w') as fc:
|
|
with open('out/httplib.cc', 'w') as fc:
|
|
|
fc.write('#include "httplib.h"\n')
|
|
fc.write('#include "httplib.h"\n')
|