williballenthin / python-registry

Pure Python parser for Windows Registry hives.
Apache License 2.0
426 stars 101 forks source link

Sample amcache.yp not compatible with Python < 2.7 #64

Closed hacktobeer closed 8 years ago

hacktobeer commented 8 years ago

I have a few servers using Python 2.6. The amcache.py sample contains a dict comprehension line of code that is not compatible with python < 2.7.

Line giving Syntax Error:

return ExecutionEntry(**{e.name:e.getter(key) for e in FIELDS})

Possible fix:

return ExecutionEntry(dict(e.name, e.getter(key)) for e in FIELDS))
williballenthin commented 8 years ago

@hacktobeer thanks for pointing this out and providing a suggested solution

i'll go ahead and update the script to use the dict(), method.

would you confirm the scripts otherwise runs fine on python 2.6? its been a little while since i tested with 2.6.

hacktobeer commented 8 years ago

So far script runs fine. Will use it on a big amount of data over the weekend. If I run into problems, I'll let you know. Thanks for the quick response, much appreciated!

williballenthin commented 8 years ago

you're welcome!