1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 18:06:13 +01:00

- properly use tempfile.mkstemp, by using os.fdopen() on the passed file

descriptor, instead of opening it again
This commit is contained in:
Dr. Peter Poeml 2006-07-14 16:38:54 +00:00
parent 55857910d4
commit d6af7d2f85

View File

@ -10,8 +10,8 @@ from osc.core import init_basicauth
if __name__ == '__main__': if __name__ == '__main__':
(o, filename) = tempfile.mkstemp(prefix = 'osc_profiledata_', dir = '/dev/shm') (fd, filename) = tempfile.mkstemp(prefix = 'osc_profiledata_', dir = '/dev/shm')
del o f = os.fdopen(fd)
try: try:
@ -30,4 +30,5 @@ if __name__ == '__main__':
del stats del stats
finally: finally:
f.close()
os.unlink(filename) os.unlink(filename)