Skip to content
Advertisement

Tag: porting

Port hmac.new().digest() module from Python 2.7 to 3.7

I have been struggling with this for hours. I have the following production code (parsed out for simplicity) that runs just fine in Python 2.7: The output is a string like so: But when I run this with Python3.7, I get the following error: After a quite a bit of research I understood that hmac has changed in 3.4 and

tokenize in python3.x

I have following codes in python2.x: Now problem is that in python3.x second argument does not exist. I need to call the function operations.eat() before tokenize. How can we perform the above task in python3.x. One idea is to directly call the function tokenize.eat() before ‘tokenize’ statement(last line of the code). But I am not sure about the arguments to

Advertisement