Comment 11 for bug 1040213

Revision history for this message
Julian Taylor (jtaylor) wrote :

why do you wipe the crontab if the check_output fails for some reason?
this occurs several times
+ try:
+ subprocess.check_output(['crontab', '-l'])
+ except subprocess.CalledProcessError:
+ newcron = subprocess.Popen(['crontab', '-'], stdin = subprocess.PIPE)
+ newcron.communicate("")

I'm guessing this is a typo and it should be -l in the second call too.
I don't really see why you use the try, except at all
just stick with the second version or copy paste the check_output code into your program if you want python 2.6 compatibility