projects
/
dbuscron
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8b990de
)
Don't use itertools.product any more
author
Konstantin Stepanov
<kstep@p-nut.info>
Sat, 27 Nov 2010 13:38:05 +0000
(15:38 +0200)
committer
Konstantin Stepanov
<kstep@p-nut.info>
Sat, 27 Nov 2010 13:38:05 +0000
(15:38 +0200)
dbuscron/parser.py
patch
|
blob
|
history
diff --git
a/dbuscron/parser.py
b/dbuscron/parser.py
index
f025709
..
46df350
100644
(file)
--- a/
dbuscron/parser.py
+++ b/
dbuscron/parser.py
@@
-2,18
+2,15
@@
from __future__ import with_statement
import re
from dbuscron.bus import DbusBus
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+')
class CrontabParser(object):
__fields_sep = re.compile(r'\s+')