From f24139d455af3a179fe1d19c951e4cd85744c592 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 18 Aug 2019 06:40:24 +0200 Subject: Use python2 for doc extract --- doc/doc_extract.py | 11 +++++------ 1 file 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): -- cgit v1.2.3