1
0
forked from VimPlug/jedi

added an own implementation for hasattr (python 2, python 3 is fine)

This commit is contained in:
David Halter
2012-07-13 01:27:41 +02:00
parent 47da6f297f
commit 24577bc632
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -77,3 +77,14 @@ try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
# hasattr function used because python
if sys.hexversion >= 0x03000000:
hasattr = hasattr
else:
def hasattr(obj, name):
try:
getattr(obj, name)
return True
except AttributeError:
return False