We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7437456 commit 1afd6f1Copy full SHA for 1afd6f1
1 file changed
opencage/command_line.py
@@ -1,7 +1,7 @@
1
import argparse
2
import sys
3
-import os
4
import io
+from pathlib import Path
5
import re
6
import csv
7
@@ -72,9 +72,9 @@ def parse_args(args):
72
73
options = parser.parse_args(args)
74
75
- if os.path.exists(options.output) and not options.dry_run:
+ if Path(options.output).exists() and not options.dry_run:
76
if options.overwrite:
77
- os.remove(options.output)
+ Path(options.output).unlink()
78
else:
79
print(
80
f"Error: The output file '{options.output}' already exists. You can add --overwrite to your command.",
0 commit comments