Skip to content

Fix Python 3 AttributeError in BinSummarizer synthesized bins - #70

Open
yang00333 wants to merge 1 commit into
cmars:mainfrom
yang00333:fix/py3-summarizers
Open

yang00333 wants to merge 1 commit into
cmars:mainfrom
yang00333:fix/py3-summarizers

Conversation

@yang00333

Copy link
Copy Markdown

ssue

BinSummarizer.getSiteSynthHbins() and getSiteSynthSbins() call dict.iteritems(), which only exists in Python 2. Since pystdf requires Python 3.8+, both methods always raise:

AttributeError: 'dict' object has no attribute 'iteritems'

To reproduce: parse data/demofile.stdf with a BinSummarizer attached, then call list(summarizer.getSiteSynthHbins()).

Fix

Replace .iteritems() with .items() in both methods. With the fix, the existing tests still pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant