Mercurial > ~astiob > upreckon > hgweb
changeset 27:dc4be35d17e0
Bug fixes
Bug fix: compat.py now works in Python 3 (module __builtin__ was renamed builtins).
Bug fix: random spaces in the indentation of testcases.py have been removed.
Bug fix: false dummy{in,out}name's are now again replaced with the values of testcase{in,out}name.
author | Oleg Oshmyan <chortos@inbox.lv> |
---|---|
date | Fri, 15 Oct 2010 22:17:31 +0000 |
parents | 5bbb68833868 |
children | 3d535503161f |
files | 2.00/compat.py 2.00/config.py 2.00/testcases.py |
diffstat | 3 files changed, 18 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/2.00/compat.py Thu Sep 23 23:50:45 2010 +0000 +++ b/2.00/compat.py Fri Oct 15 22:17:31 2010 +0000 @@ -25,7 +25,10 @@ # with Python 2 and not usable conditionally via exec() and such # because it is a detail of the syntax of the class statement itself. -import __builtin__ +try: + import builtins +except ImportError: + import __builtin__ as builtins __all__ = ('say', 'basestring', 'range', 'map', 'zip', 'filter', 'items', 'keys', 'values', 'zip_longest', 'callable', @@ -40,7 +43,7 @@ # An alternative is exec('from __future__ import print_function; say = print'); # if problems arise with the current line, one should try replacing it # with this one with the future import before abandoning the idea altogether - say = __builtins__['print'] + say = getattr(builtins, 'print') except Exception: # Python 2.5 import sys @@ -144,12 +147,12 @@ def __enter__(self): g = globals() for name in __all__: - if hasattr(__builtin__, name): - self.originals[name] = getattr(__builtin__, name) - setattr(__builtin__, name, g[name]) + if hasattr(builtins, name): + self.originals[name] = getattr(builtins, name) + setattr(builtins, name, g[name]) def __exit__(self, exc_type, exc_val, exc_tb): for name in self.originals: - setattr(__builtin__, name, self.originals[name]) + setattr(builtins, name, self.originals[name]) # Support simple testconf.py's written for test.py 1.x -__builtin__.xrange = range \ No newline at end of file +builtins.xrange = range \ No newline at end of file
--- a/2.00/config.py Thu Sep 23 23:50:45 2010 +0000 +++ b/2.00/config.py Fri Oct 15 22:17:31 2010 +0000 @@ -122,6 +122,10 @@ for name in defaults_problem: if not hasattr(globalconf, name): setattr(module, name, getattr(module, name, defaults_problem[name])) + if not module.dummyinname: + module.dummyinname = getattr(module, 'testcaseinname', module.dummyinname) + if not module.dummyoutname: + module.dummyoutname = getattr(module, 'testcaseoutname', module.dummyoutname) if not hasattr(module, 'path'): if hasattr(module, 'name'): module.path = module.name
--- a/2.00/testcases.py Thu Sep 23 23:50:45 2010 +0000 +++ b/2.00/testcases.py Fri Oct 15 22:17:31 2010 +0000 @@ -393,7 +393,7 @@ raise CanceledByUser else: time_next_check = now + .15 - time.sleep(0) + time.sleep(0) else: time_end = case.time_started + case.maxtime while True: @@ -409,7 +409,7 @@ raise CanceledByUser else: time_next_check = now + .15 - time.sleep(0) + time.sleep(0) if config.globalconf.force_zero_exitcode and case.process.returncode: raise NonZeroExitCode(case.process.returncode) callback() @@ -442,7 +442,7 @@ raise CanceledByUser else: time_next_check = now + .15 - time.sleep(0) + time.sleep(0) else: time_end = case.time_started + case.maxtime while True: @@ -458,7 +458,7 @@ raise CanceledByUser else: time_next_check = now + .15 - time.sleep(0) + time.sleep(0) if config.globalconf.force_zero_exitcode and case.process.returncode: raise NonZeroExitCode(case.process.returncode) callback()