File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 49
49
"name" : " 1.0" ,
50
50
"version" : " 1.0" ,
51
51
"url" : " https://pandas.pydata.org/pandas-docs/version/1.0/"
52
- }
52
+ },
53
53
]
Original file line number Diff line number Diff line change @@ -495,4 +495,15 @@ def main(
495
495
"--target-path" , default = "build" , help = "directory where to write the output"
496
496
)
497
497
args = parser .parse_args ()
498
+
499
+ # Sanity check: validate that versions.json is valid JSON
500
+ versions_path = os .path .join (args .source_path , "versions.json" )
501
+ if os .path .exists (versions_path ):
502
+ try :
503
+ with open (versions_path , encoding = "utf-8" ) as f :
504
+ json .load (f )
505
+ except json .JSONDecodeError as e :
506
+ sys .stderr .write (f"\n [ERROR] Invalid JSON in { versions_path } :\n { e } \n " )
507
+ sys .exit (1 )
508
+
498
509
sys .exit (main (args .source_path , args .target_path ))
You can’t perform that action at this time.
0 commit comments