Commit 6e1628d
committed
Fix urlopen() for Python 2 in runqemu.py
`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 6e1628d
1 file changed
+8
-12
lines changed| 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 | | - | |
| 163 | + | |
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
| |||
211 | 207 | | |
212 | 208 | | |
213 | 209 | | |
214 | | - | |
| 210 | + | |
215 | 211 | | |
216 | 212 | | |
217 | 213 | | |
| |||
292 | 288 | | |
293 | 289 | | |
294 | 290 | | |
295 | | - | |
| 291 | + | |
296 | 292 | | |
297 | 293 | | |
298 | 294 | | |
| |||
0 commit comments