example of next(, None) (#24345)

This commit is contained in:
Asuka Minato 2025-08-22 19:32:22 +09:00 committed by GitHub
parent 2a43e634e8
commit 51cc2bf429
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -34,9 +34,8 @@ class ExcelExtractor(BaseExtractor):
for sheet_name in wb.sheetnames:
sheet = wb[sheet_name]
data = sheet.values
try:
cols = next(data)
except StopIteration:
cols = next(data, None)
if cols is None:
continue
df = pd.DataFrame(data, columns=cols)