mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-12 23:56: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:
parent
55857910d4
commit
d6af7d2f85
@ -10,8 +10,8 @@ from osc.core import init_basicauth
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
(o, filename) = tempfile.mkstemp(prefix = 'osc_profiledata_', dir = '/dev/shm')
|
||||
del o
|
||||
(fd, filename) = tempfile.mkstemp(prefix = 'osc_profiledata_', dir = '/dev/shm')
|
||||
f = os.fdopen(fd)
|
||||
|
||||
try:
|
||||
|
||||
@ -30,4 +30,5 @@ if __name__ == '__main__':
|
||||
del stats
|
||||
|
||||
finally:
|
||||
f.close()
|
||||
os.unlink(filename)
|
||||
|
Loading…
Reference in New Issue
Block a user