Fix doc example bug reported on python-list by Akshay Verma.
Merge with 3.4