From: Konstantin Stepanov Date: Sat, 27 Nov 2010 13:38:05 +0000 (+0200) Subject: Don't use itertools.product any more X-Git-Tag: v1.1.0~33 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=d2d0b75eb5e3223a3aab8f6624a43791a2593031;p=dbuscron Don't use itertools.product any more --- diff --git a/dbuscron/parser.py b/dbuscron/parser.py index f025709..46df350 100644 --- a/dbuscron/parser.py +++ b/dbuscron/parser.py @@ -2,18 +2,15 @@ from __future__ import with_statement import re from dbuscron.bus import DbusBus -try: - from itertools import product -except ImportError: - def product(*args): - if args: - head, tail = args[0], args[1:] - for h in head: - for t in product(*tail): - yield (h,) + t - - else: - yield () +def product(*args): + if args: + head, tail = args[0], args[1:] + for h in head: + for t in product(*tail): + yield (h,) + t + + else: + yield () class CrontabParser(object): __fields_sep = re.compile(r'\s+')