Remove quotes from a string.
(str)
| 355 | |
| 356 | # rfc822.unquote() doesn't properly de-backslash-ify in Python pre-2.3. |
| 357 | def unquote(str): |
| 358 | """Remove quotes from a string.""" |
| 359 | if len(str) > 1: |
| 360 | if str.startswith('"') and str.endswith('"'): |
| 361 | return str[1:-1].replace('\\\\', '\\').replace('\\"', '"') |
| 362 | if str.startswith('<') and str.endswith('>'): |
| 363 | return str[1:-1] |
| 364 | return str |
| 365 | |
| 366 | |
| 367 |
no test coverage detected
searching dependent graphs…