python2 code get error when using python3.5
This question already has an answer here:
has_key is removed in python3, but you shouldn't be using it in 2 either. Use the in operator:
if self.cross_compile and 'PYTHONXCPREFIX' in os.environ:
has_key() was removed in Python 3.x. Use in or get
'PYTHONXCPREFIX' in os.environ
Using get
os.environ.get('PYTHONXCPREFIX') . if does not exists it returns None.
It can returns False as well, passing it as default value.
os.environ.get('PYTHONXCPREFIX', False)
链接地址: http://www.djcxy.com/p/28890.html
