diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-02 15:12:43 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-02 13:20:53 +0000 |
commit | 049d732772ee707590026ae9d902e44d08a3ecfa (patch) | |
tree | 9310285a3c639e982afa85077103869dd861911d | |
parent | 6d34a5e306c813faf7cd1fbc41f1b28952a0a354 (diff) |
shiboken/embedding_generator: Silence warning about leaked file
Close the temporary file, fixing:
sources/shiboken2/libshiboken/embed/embedding_generator.py:241: ResourceWarning: unclosed file <_io.TextIOWrapper name=3 mode='w+' encoding='cp1252'>
Change-Id: Idc89853fdca2a2a951e723d4b8840e3ebfb7c06c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r-- | sources/shiboken2/libshiboken/embed/embedding_generator.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/embed/embedding_generator.py b/sources/shiboken2/libshiboken/embed/embedding_generator.py index 3ee96a1a5..b6bfb1467 100644 --- a/sources/shiboken2/libshiboken/embed/embedding_generator.py +++ b/sources/shiboken2/libshiboken/embed/embedding_generator.py @@ -128,6 +128,7 @@ def create_zipfile(limited_api): tmp.seek(0) with open(inc_name, "w") as inc: _embed_file(tmp, inc) + tmp.close() # also generate a simple embeddable .pyc file for signature_bootstrap.pyc boot_name = "signature_bootstrap.py" if limited_api else "signature_bootstrap.pyc" with open(boot_name, "rb") as ldr, open("signature_bootstrap.inc", "w") as inc: |