Commit c16c209
Pass
The behavior of
[`NamedTemporaryFile()`](https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile)
is slightly different on Windows when the file is accessed multiple times in
the same context manager. `delete_on_close=False` allows the file to exist
until the end of the context manager, which is the behavior we want in all
platforms.
Unfortunately this argument was only added in Python `3.12`, so we add a switch
to support earlier versions. We may remove it in the future once `3.11` is EOL.
Please see PR #265 for
details (and thanks to @NingLi670 for opening the original PR).
PiperOrigin-RevId: 732961399delete_on_close=False to NamedTemporaryFile().1 parent b8e0d77 commit c16c209
File tree
2 files changed
+15
-2
lines changed- android_env/components
2 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
284 | 292 | | |
285 | 293 | | |
286 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | | - | |
| 107 | + | |
103 | 108 | | |
104 | 109 | | |
105 | 110 | | |
| |||
0 commit comments