Ivan Zakharyaschev <i...@altlinux.org> added the comment: Thanks! I also thought about this simplest way. What about this:
diff --git a/Python/Lib/test/test_resource.py b/Python/Lib/test/test_resource.py index de29d3b..bec4440 100644 --- a/Python/Lib/test/test_resource.py +++ b/Python/Lib/test/test_resource.py @@ -102,16 +102,21 @@ class ResourceTest(unittest.TestCase): # Issue 6083: Reference counting bug def test_setrusage_refcount(self): + howmany = 1000000 try: limits = resource.getrlimit(resource.RLIMIT_CPU) except AttributeError: self.skipTest('RLIMIT_CPU not available') + try: + resource.setrlimit(resource.RLIMIT_CPU, (howmany, howmany)) + except _: + self.skipTest('Setting RLIMIT_CPU not possible') class BadSequence: def __len__(self): return 2 def __getitem__(self, key): if key in (0, 1): - return len(tuple(range(1000000))) + return len(tuple(range(howmany))) raise IndexError resource.setrlimit(resource.RLIMIT_CPU, BadSequence()) What should I write instead of _? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue6083> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com