diff options
Diffstat (limited to 'Demo/pdist/rrcs.py')
-rwxr-xr-x | Demo/pdist/rrcs.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/Demo/pdist/rrcs.py b/Demo/pdist/rrcs.py index ecb01a2..a07260c 100755 --- a/Demo/pdist/rrcs.py +++ b/Demo/pdist/rrcs.py @@ -102,17 +102,13 @@ def diff(x, copts, fn): flags = flags + ' ' + o + a flags = flags[1:] data = x.get(fn) - tfn = tempfile.mktemp() - try: - tf = open(tfn, 'w') - tf.write(data) - tf.close() - print 'diff %s -r%s %s' % (flags, x.head(fn), 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, x.head(fn), fn) + sts = os.system('diff %s %s %s' % (flags, tf.name, fn)) + if sts: + print '='*70 def same(x, copts, fn, data = None): if data is None: |