Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eecea8f

Browse filesBrowse files
[3.12] gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321) (gh-126328)
gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321) (cherry picked from commit cfb1b2f) Co-authored-by: simple-is-great <103080930+simple-is-great@users.noreply.github.com>
1 parent b592699 commit eecea8f
Copy full SHA for eecea8f

File tree

Expand file treeCollapse file tree

1 file changed

+5
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-9
lines changed

‎Lib/test/test_zlib.py

Copy file name to clipboardExpand all lines: Lib/test/test_zlib.py
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -506,20 +506,16 @@ def test_flushes(self):
506506

507507
for sync in sync_opt:
508508
for level in range(10):
509-
try:
509+
with self.subTest(sync=sync, level=level):
510510
obj = zlib.compressobj( level )
511511
a = obj.compress( data[:3000] )
512512
b = obj.flush( sync )
513513
c = obj.compress( data[3000:] )
514514
d = obj.flush()
515-
except:
516-
print("Error for flush mode={}, level={}"
517-
.format(sync, level))
518-
raise
519-
self.assertEqual(zlib.decompress(b''.join([a,b,c,d])),
520-
data, ("Decompress failed: flush "
521-
"mode=%i, level=%i") % (sync, level))
522-
del obj
515+
self.assertEqual(zlib.decompress(b''.join([a,b,c,d])),
516+
data, ("Decompress failed: flush "
517+
"mode=%i, level=%i") % (sync, level))
518+
del obj
523519

524520
@unittest.skipUnless(hasattr(zlib, 'Z_SYNC_FLUSH'),
525521
'requires zlib.Z_SYNC_FLUSH')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.