aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-18 06:40:24 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitf24139d455af3a179fe1d19c951e4cd85744c592 (patch)
tree86c87d498982bd66fd77dcc2553efe5208d54135 /doc
parentd4d33a89586b5210d1f0bc81d95fa2b640da659b (diff)
Use python2 for doc extract
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/doc_extract.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/doc/doc_extract.py b/doc/doc_extract.py
index ae44677..3331ae0 100755
--- a/doc/doc_extract.py
+++ b/doc/doc_extract.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python2
import sys
import os
@@ -18,11 +18,10 @@ def lstrip_lines(string):
for line in string.splitlines():
result.append(line.lstrip())
- if len(result) > 0:
- if len(result[0].strip()) == 0:
- del result[0]
- if len(result[-1].strip()) == 0:
- del result[-1]
+ if len(result) > 0 and len(result[0].strip()) == 0:
+ del result[0]
+ if len(result) > 0 and len(result[-1].strip()) == 0:
+ del result[-1]
return "\n".join(result)
def extract_docs(filepath):