patch for backward compatibility with python version less than 2.7