Made workaround even uglier, but it works for python2 and 3 #273