Skip to content

Commit

Permalink
ref: commented out bad code and replaced with NotImplementedError (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Feb 10, 2023
1 parent 7f9a259 commit 3f133b3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions igor2/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,17 @@ def pack_data(self, data=None):
for arg in self.pack_item(item):
yield arg
if items < self.item_count:
if f.default is None:
raise ValueError(
'no default for {}.{}'.format(self, f))
for i in range(self.item_count - items):
yield f.default
raise NotImplementedError(
"You have reached a bad state! Please copy the "
"code and data you used to get here and paste it at "
"https://github.com/AFM-analysis/igor2/issues/5")
# https://github.com/AFM-analysis/igor2/issues/5
# Original code from W. Trevor King:
# if f.default is None:
# raise ValueError(
# 'no default for {}.{}'.format(self, f))
# for i in range(self.item_count - items):
# yield f.default
else:
for index in self.indexes():
try:
Expand Down

0 comments on commit 3f133b3

Please sign in to comment.