summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/rcvs.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/pdist/rcvs.py')
-rwxr-xr-xDemo/pdist/rcvs.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/Demo/pdist/rcvs.py b/Demo/pdist/rcvs.py
index 9129c28..24036c7 100755
--- a/Demo/pdist/rcvs.py
+++ b/Demo/pdist/rcvs.py
@@ -172,17 +172,13 @@ class MyFile(File):
if self.lsum == sum:
return
import tempfile
- tfn = tempfile.mktemp()
- try:
- tf = open(tfn, 'w')
- tf.write(data)
- tf.close()
- print 'diff %s -r%s %s' % (flags, rev, fn)
- sts = os.system('diff %s %s %s' % (flags, tfn, fn))
- if sts:
- print '='*70
- finally:
- remove(tfn)
+ tf = tempfile.NamedTemporaryFile()
+ tf.write(data)
+ tf.flush()
+ print 'diff %s -r%s %s' % (flags, rev, fn)
+ sts = os.system('diff %s %s %s' % (flags, tf.name, fn))
+ if sts:
+ print '='*70
def commitcheck(self):
return self.action() != 'C'