seomoz / simhash-py

Simhash and near-duplicate detection
MIT License
408 stars 115 forks source link

[Enhancement] Make simhash compatible with Python>=3.9 #54

Open HYLcool opened 1 year ago

HYLcool commented 1 year ago

In Python>=3.8, the field tp_print is renamed as tp_vectorcall_offset(ref). So, when install simhash-py under Python 3.9 or later, an error would occur during building like below:

simhash/simhash.cpp:2112:73: error: no member named 'tp_print' in '_typeobject'

To make simhash compatible with Python>=3.9, I add a version check when applying assignment to this field.