Commit c7e64ed
authored
Fix urlopen() for Python 2 in runqemu.py (#184)
`get_metadata_from_url()` previousl fell back to urllib.urlopen() on
HTTPErrors, due to its overly wide `except` (never catch `Exception`!),
which leads to unnecessarily long and confusing backtraces.
Other places did not have a Python 2 fallback at all. Directly import
the `urlopen` function from the respective module to simplify the code.
Also drop the unused `urllib.parse` import.1 parent 77544b4 commit c7e64ed
1 file changed
Lines changed: 8 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
22 | 21 | | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 152 | + | |
| 153 | + | |
158 | 154 | | |
159 | 155 | | |
160 | 156 | | |
| |||
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
167 | | - | |
168 | | - | |
169 | | - | |
| 163 | + | |
170 | 164 | | |
171 | 165 | | |
172 | 166 | | |
| |||
211 | 205 | | |
212 | 206 | | |
213 | 207 | | |
214 | | - | |
| 208 | + | |
215 | 209 | | |
216 | 210 | | |
217 | 211 | | |
| |||
292 | 286 | | |
293 | 287 | | |
294 | 288 | | |
295 | | - | |
| 289 | + | |
296 | 290 | | |
297 | 291 | | |
298 | 292 | | |
| |||
0 commit comments