util: improved the check for the existence of the 'buffer' builtin
2to3 is unable to translate '__builtin__' calls to 'builtins' when
hasattr is used (as in hasattr(__builtin__, buffer)). Translating the
check to the format
try:
whatever
except NameError
# define whatever
__builtin__.whatever = whatever
is a correct way of checking for the name and has the benefit of being
translated by 2to3. This patch implements the same idea for the
aforementioned example.
changeset: 0:9c2cf2b35aa7
user: test
date: Mon Jan 12 13:46:40 1970 +0000
summary: add foo
changeset: 1:3756a9556b89
tag: tip
user: test
date: Mon Jan 12 13:46:41 1970 +0000
summary: change foo
2 revisions:
9c2cf2b35aa7
3756a9556b89