Remove quotes from a string.
(str)
| 220 | |
| 221 | # rfc822.unquote() doesn't properly de-backslash-ify in Python pre-2.3. |
| 222 | def unquote(str): |
| 223 | """Remove quotes from a string.""" |
| 224 | if len(str) > 1: |
| 225 | if str.startswith('"') and str.endswith('"'): |
| 226 | return str[1:-1].replace('\\\\', '\\').replace('\\"', '"') |
| 227 | if str.startswith('<') and str.endswith('>'): |
| 228 | return str[1:-1] |
| 229 | return str |
| 230 | |
| 231 | |
| 232 |
no test coverage detected