Message314286
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 _? |
|
Date |
User |
Action |
Args |
2018-03-22 18:47:34 | imz | set | recipients:
+ imz, loewis, georg.brandl, gregory.p.smith, belopolsky, billm, abacabadabacaba, python-dev, serhiy.storchaka |
2018-03-22 18:47:34 | imz | set | messageid: <1521744454.53.0.467229070634.issue6083@psf.upfronthosting.co.za> |
2018-03-22 18:47:34 | imz | link | issue6083 messages |
2018-03-22 18:47:34 | imz | create | |
|