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:
parent
55857910d4
commit
d6af7d2f85
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user