mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	* wdbframewin.py (re_eval): set __privileged__ in globals so private
variables can still be seen by the debugger * ftplib.py (retrlines): args should be *args. * ChangeLog: entries for Sjoerd's addition sunau.py and changes to aiff.py * test_md5.py: test program for built-in md5 module
This commit is contained in:
		
							parent
							
								
									6930b3d18d
								
							
						
					
					
						commit
						79c85f1778
					
				
					 4 changed files with 27 additions and 1 deletions
				
			
		|  | @ -283,7 +283,7 @@ def retrbinary(self, cmd, callback, blocksize): | |||
| 	# The callback function is called for each line, with trailing | ||||
| 	# CRLF stripped.  This creates a new port for you. | ||||
| 	# print_lines is the default callback  | ||||
| 	def retrlines(self, cmd, args): | ||||
| 	def retrlines(self, cmd, *args): | ||||
| 		callback = None | ||||
| 		if args: | ||||
| 			callback = args[0] | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ def re_eval(self): | |||
| 			output = '' | ||||
| 		else: | ||||
| 			globals = self.frame.f_globals | ||||
| 			globals['__privileged__'] = 1 | ||||
| 			locals = self.dict | ||||
| 			try: | ||||
| 				value = eval(expr, globals, locals) | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ def re_eval(self): | |||
| 			output = '' | ||||
| 		else: | ||||
| 			globals = self.frame.f_globals | ||||
| 			globals['__privileged__'] = 1 | ||||
| 			locals = self.dict | ||||
| 			try: | ||||
| 				value = eval(expr, globals, locals) | ||||
|  |  | |||
							
								
								
									
										24
									
								
								Lib/test/test_md5.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								Lib/test/test_md5.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,24 @@ | |||
| # Testing md5 module | ||||
| 
 | ||||
| import string | ||||
| from md5 import md5 | ||||
| 
 | ||||
| def hexstr(s): | ||||
| 	h = string.hexdigits | ||||
| 	r = '' | ||||
| 	for c in s: | ||||
| 		i = ord(c) | ||||
| 		r = r + h[(i >> 4) & 0xF] + h[i & 0xF] | ||||
| 	return r | ||||
| 
 | ||||
| def md5test(s): | ||||
| 	return 'MD5 ("' + s + '") = ' + hexstr(md5(s).digest()) | ||||
| 
 | ||||
| print 'MD5 test suite:' | ||||
| print md5test('') | ||||
| print md5test('a') | ||||
| print md5test('abc') | ||||
| print md5test('message digest') | ||||
| print md5test('abcdefghijklmnopqrstuvwxyz') | ||||
| print md5test('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') | ||||
| print md5test('12345678901234567890123456789012345678901234567890123456789012345678901234567890') | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum