[umessage] Use the same code paths for both python 2 and 3 [applied]