ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.86k stars 295 forks source link

Use print() function in both Python 2 and Python 3 #309

Closed cclauss closed 5 years ago

cclauss commented 5 years ago

Legacy print statements are syntax errors in Python 3 but print() function works as expected in both Python 2 and Python 3.

Also, use with open() as context manager syntax to automate file.close() even in the face of exceptions.

cclauss commented 5 years ago

Fixing these syntax errors would be helpful because this code is vendored into:

ugorji commented 5 years ago

@cclauss

Thanks for the fix. I am not too versed with the python 2 vs 3 differences, so had to do some research first before accepting.

cclauss commented 5 years ago

No problems. Thanks for doing this.