Mercurial > ~astiob > upreckon > hgweb
view publish.py @ 31:fe1463e7e24d
Clean up try-except clauses
More try-except-else goodness (with the stress on else).
Bug fix: compat.py now creates zip_longest in Python 2.5 instead of raising an exception.
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Thu, 25 Nov 2010 00:03:29 +0000 |
parents | a2c9f7cfa174 |
children |
line wrap: on
line source
#! /usr/bin/python # Copyright (c) 2009-2010 Chortos-2 <chortos@inbox.lv> with open('test-svn.py') as t: f = t.read() i = f.find('# $Rev: ') j = f.find('\n', i) rev = f[i+8:j-2] f = f[0:i] + f[j+1:] f = f.replace('$$REV$$', rev) with open('test.py', 'wb') as t: t.write(f)