File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,9 @@ def pypi_stats_api(
162162 elif total == "all" :
163163 res ["data" ] = _total (res ["data" ])
164164 elif total is not None :
165- raise ValueError (f"invalid value { total } provided for total: use 'all' or 'monthly'" )
165+ raise ValueError (
166+ f"invalid value { total } provided for total: use 'all' or 'monthly'"
167+ )
166168
167169 if format == "json" :
168170 return json .dumps (res )
@@ -335,7 +337,11 @@ def _percent(data: dict | list) -> dict | list:
335337 grand_total = _grand_total_value (data )
336338
337339 for row in data :
338- row ["percent" ] = "N/A" if grand_total == 0 else "{:.2%}" .format (row ["downloads" ] / grand_total )
340+ row ["percent" ] = (
341+ "N/A"
342+ if grand_total == 0
343+ else "{:.2%}" .format (row ["downloads" ] / grand_total )
344+ )
339345
340346 return data
341347
You can’t perform that action at this time.
0 commit comments