(args)
| 292 | |
| 293 | |
| 294 | def remove_quotes_from_args(args): |
| 295 | if sys.platform == "win32": |
| 296 | new_args = [] |
| 297 | |
| 298 | for x in args: |
| 299 | if isinstance(x, Path): |
| 300 | x = str(x) |
| 301 | else: |
| 302 | if not isinstance(x, (bytes, str)): |
| 303 | raise InvalidTypeInArgsException(str(type(x))) |
| 304 | |
| 305 | double_quote, two_double_quotes = _get_str_type_compatible(x, ['"', '""']) |
| 306 | |
| 307 | if x != two_double_quotes: |
| 308 | if len(x) > 1 and x.startswith(double_quote) and x.endswith(double_quote): |
| 309 | x = x[1:-1] |
| 310 | |
| 311 | new_args.append(x) |
| 312 | return new_args |
| 313 | else: |
| 314 | new_args = [] |
| 315 | for x in args: |
| 316 | if isinstance(x, Path): |
| 317 | x = x.as_posix() |
| 318 | else: |
| 319 | if not isinstance(x, (bytes, str)): |
| 320 | raise InvalidTypeInArgsException(str(type(x))) |
| 321 | new_args.append(x) |
| 322 | |
| 323 | return new_args |
| 324 | |
| 325 | |
| 326 | def quote_arg_win32(arg): |
no test coverage detected