This is the patch from c98b12d9a9 (#7931), applied for both python 2 and 3. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
c98b12d9a9