This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-ponymail-unit-tests.git


The following commit(s) were added to refs/heads/master by this push:
     new afce54e  fix caller check; allow for generator interface
afce54e is described below

commit afce54e7c7dca502dc8bce57e72a5347778a05d4
Author: Sebb <[email protected]>
AuthorDate: Wed Jun 2 13:17:38 2021 +0100

    fix caller check; allow for generator interface
    
    The caller check was broken, but was not noticed
    because the tests were not being run...
    Also since the check was written, the code has been
    split off into a separate file
---
 tests/test-generators.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/test-generators.py b/tests/test-generators.py
index 1dbd36f..b9ae9e0 100755
--- a/tests/test-generators.py
+++ b/tests/test-generators.py
@@ -179,9 +179,9 @@ def main():
         save_gmtime = time.gmtime
         def _time_gmtime(secs=None):
             if secs is None:
-                callers = traceback.extract_stack(limit=1)
-                [filename, _, _, _] = callers[0]
-                if filename.endswith("/tools/archiver.py"):
+                callers = traceback.extract_stack(limit=2) # want last-1 and 
last (i.e. here)
+                [filename, _, _, _] = callers[0] # This is last-1, i.e. my 
caller
+                if filename.endswith("/tools/archiver.py") or 
filename.endswith("tools/generators.py"):
                     return save_gmtime(0)
             return save_gmtime(secs)
 

Reply via email to