File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 7373# - id: flake8
7474# args: ['--ignore=E501']
7575- repo : https://github.com/jendrikseipp/vulture
76- rev : ' v2.7 ' # or any later Vulture version
76+ rev : ' v2.9.1 ' # or any later Vulture version
7777 hooks :
7878 - id : vulture
7979 args : ['scan.py', ]
Original file line number Diff line number Diff line change 1313from datetime import datetime
1414import requests
1515
16- # Define the timestamp as a string, which will be the same throughout the execution of the script.
17- timestamp = datetime .now ().isoformat (timespec = "minutes" )
16+ # accomodate windows and unix path
17+ timestamp = datetime .now ().isoformat (timespec = "minutes" ). replace ( ":" , "-" )
1818
1919
2020def get_json_from_url (url ):
@@ -314,7 +314,10 @@ def main(
314314 results .extend (region_results )
315315 for service_result in region_results :
316316 directory = os .path .join (output_dir , timestamp , region )
317- os .makedirs (directory , exist_ok = True )
317+ try :
318+ os .makedirs (directory , exist_ok = True )
319+ except NotADirectoryError :
320+ log .error ("Invalid directory name: %s" , directory )
318321 with open (
319322 os .path .join (directory , f"{ service_result ['service' ]} .json" ),
320323 "w" ,
You can’t perform that action at this time.
0 commit comments