porting py3k