mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
change back to prevent accidental infinite recursion
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
This commit is contained in:
parent
15a863e645
commit
209954ee2f
1 changed files with 6 additions and 1 deletions
|
|
@ -390,7 +390,12 @@ class Tally(_FortranObjectWithID):
|
|||
|
||||
class _TallyMapping(Mapping):
|
||||
def __getitem__(self, key):
|
||||
return Tally(index=self[key])
|
||||
index = c_int32()
|
||||
try:
|
||||
_dll.openmc_get_tally_index(key, index)
|
||||
except (AllocationError, InvalidIDError) as e:
|
||||
# __contains__ expects a KeyError to work correctly
|
||||
raise KeyError(str(e))
|
||||
|
||||
def __iter__(self):
|
||||
for i in range(len(self)):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue