From 99d13f0429e3a3af2b46b617d776b9d46d6c5438 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 20 Oct 2010 20:07:31 +0200 Subject: macro.py, macro2m4.py: minor fixes to make those scripts run with Python 3 --- macro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'macro.py') diff --git a/macro.py b/macro.py index d8192cf..36dabc8 100755 --- a/macro.py +++ b/macro.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -from __future__ import with_statement + from contextlib import closing import re import os.path as path @@ -70,7 +70,7 @@ class Macro: # drop initial header (if present) header = re.sub(r"^\n*# =+\n#[^\n]*\n# =+\n(#\n)+", '', header, 1) # split buffer into lines and drop initial "# " prefix in the process - header = map(lambda l: l[2:], header.split('\n')) + header = [l[2:] for l in header.split('\n')] # set defaults self.authors = [] # parse each section in the remaining list -- cgit v1.2.1