mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Silence BytesWarning (backport 267a4d4d9d65).
This commit is contained in:
		
							parent
							
								
									bc27a050a7
								
							
						
					
					
						commit
						fe4ef392d5
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		|  | @ -8,8 +8,8 @@ | |||
| import errno | ||||
| 
 | ||||
| from test.support import (TESTFN, captured_output, check_impl_detail, | ||||
|                           cpython_only, gc_collect, run_unittest, no_tracing, | ||||
|                           unlink) | ||||
|                           check_warnings, cpython_only, gc_collect, | ||||
|                           no_tracing, run_unittest, unlink) | ||||
| 
 | ||||
| class NaiveException(Exception): | ||||
|     def __init__(self, x): | ||||
|  | @ -960,9 +960,10 @@ def test_attributes(self): | |||
| 
 | ||||
|     def test_non_str_argument(self): | ||||
|         # Issue #15778 | ||||
|         arg = b'abc' | ||||
|         exc = ImportError(arg) | ||||
|         self.assertEqual(str(arg), str(exc)) | ||||
|         with check_warnings(('', BytesWarning), quiet=True): | ||||
|             arg = b'abc' | ||||
|             exc = ImportError(arg) | ||||
|             self.assertEqual(str(arg), str(exc)) | ||||
| 
 | ||||
| 
 | ||||
| def test_main(): | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka