aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
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):