Show More
@@ -192,11 +192,15 b' def _showlist(name, values, mapping, plu' | |||||
192 | def one(v, tag=name): |
|
192 | def one(v, tag=name): | |
193 | try: |
|
193 | try: | |
194 | vmapping.update(v) |
|
194 | vmapping.update(v) | |
195 | except (AttributeError, ValueError): |
|
195 | # Python 2 raises ValueError if the type of v is wrong. Python | |
|
196 | # 3 raises TypeError. | |||
|
197 | except (AttributeError, TypeError, ValueError): | |||
196 | try: |
|
198 | try: | |
|
199 | # Python 2 raises ValueError trying to destructure an e.g. | |||
|
200 | # bytes. Python 3 raises TypeError. | |||
197 | for a, b in v: |
|
201 | for a, b in v: | |
198 | vmapping[a] = b |
|
202 | vmapping[a] = b | |
199 | except ValueError: |
|
203 | except (TypeError, ValueError): | |
200 | vmapping[name] = v |
|
204 | vmapping[name] = v | |
201 | return templ(tag, **pycompat.strkwargs(vmapping)) |
|
205 | return templ(tag, **pycompat.strkwargs(vmapping)) | |
202 | lastname = 'last_' + name |
|
206 | lastname = 'last_' + name |
General Comments 0
You need to be logged in to leave comments.
Login now