Skip to content

Commit

Permalink
Return false when IndexError is raised
Browse files Browse the repository at this point in the history
  • Loading branch information
sc68cal committed Sep 13, 2023
1 parent 9d2c1b4 commit 667f573
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyeapi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,10 @@ def _chunkify( self, config, indent=0 ):
last parsed (sub)section, which in turn may contain sub-sections
"""
def is_subsection_present( section, indent ):
return any( [line[ indent ] == ' ' for line in section] )
try:
return any( [line[ indent ] == ' ' for line in section] )
except IndexError:
return False
sections = {}
key = None
for line in config.splitlines( keepends=True )[ indent > 0: ]:
Expand Down

0 comments on commit 667f573

Please sign in to comment.