[cookbook] Fix compability issue of Python 3.2