diff options
Diffstat (limited to 'QMTest/TestCommon.py')
-rw-r--r-- | QMTest/TestCommon.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py index fce0fc8..fcd3e70 100644 --- a/QMTest/TestCommon.py +++ b/QMTest/TestCommon.py @@ -95,10 +95,13 @@ __version__ = "0.37" import copy import os -import os.path import stat import sys -import UserList +try: + from collections import UserList +except ImportError: + # no 'collections' module or no UserList in collections + exec('from UserList import UserList') from TestCmd import * from TestCmd import __all__ @@ -171,8 +174,7 @@ else: dll_suffix = '.so' def is_List(e): - return isinstance(e, list) \ - or isinstance(e, UserList.UserList) + return isinstance(e, (list,UserList)) def is_writable(f): mode = os.stat(f)[stat.ST_MODE] |