Commit 430c60b 1 parent 8561f1a commit 430c60b Copy full SHA for 430c60b
File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,9 @@ def main():
35
35
from_path = os .path .normpath (args .from_path )
36
36
to_path = os .path .normpath (args .to_path )
37
37
38
- try :
38
+ if os . path . isfile ( from_path ) :
39
39
tar = tarfile .open (from_path , "r" )
40
- except IsADirectoryError :
40
+ else :
41
41
tar = None
42
42
43
43
if tar :
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def main():
52
52
logger .setLevel (logging .DEBUG )
53
53
54
54
args = argparse .ArgumentParser (description = "Create filesystem JSON. Example:\n "
55
- " ./fs2xml .py --exclude /boot/ --out fs.json /mnt/" ,
55
+ " ./fs2json .py --exclude /boot/ --out fs.json /mnt/" ,
56
56
formatter_class = argparse .RawTextHelpFormatter
57
57
)
58
58
args .add_argument ("--exclude" ,
@@ -73,9 +73,9 @@ def main():
73
73
74
74
path = os .path .normpath (args .path )
75
75
76
- try :
76
+ if os . path . isfile ( path ) :
77
77
tar = tarfile .open (path , "r" )
78
- except IsADirectoryError :
78
+ else :
79
79
tar = None
80
80
81
81
if tar :
You can’t perform that action at this time.
0 commit comments