compatible with python2 and python3 (#1145)

* compatible with python2 and python3.

* fix python version check in configure of qemu.

* allow python-2.4.

* add credit.
This commit is contained in:
Chen Huitao
2019-09-20 17:23:12 +08:00
committed by Nguyen Anh Quynh
parent c46e745338
commit f4cc35a24a
6 changed files with 52 additions and 36 deletions

View File

@ -20,7 +20,12 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from UserDict import DictMixin
try:
from UserDict import UserDict
from UserDict import DictMixin
except ImportError:
from collections import UserDict
from collections import MutableMapping as DictMixin
class OrderedDict(dict, DictMixin):
@ -94,9 +99,6 @@ class OrderedDict(dict, DictMixin):
pop = DictMixin.pop
values = DictMixin.values
items = DictMixin.items
iterkeys = DictMixin.iterkeys
itervalues = DictMixin.itervalues
iteritems = DictMixin.iteritems
def __repr__(self):
if not self: