]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* wdbframewin.py (re_eval): set __privileged__ in globals so private
authorGuido van Rossum <guido@python.org>
Tue, 14 Dec 1993 15:54:01 +0000 (15:54 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 14 Dec 1993 15:54:01 +0000 (15:54 +0000)
  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

Lib/ftplib.py
Lib/lib-stdwin/wdbframewin.py
Lib/stdwin/wdbframewin.py
Lib/test/test_md5.py [new file with mode: 0644]

index 22852bc435392a7c1288737b796b92a0a41009dd..bfb0b5b2d52599b252bd461db2e53f3f9a939d54 100644 (file)
@@ -283,7 +283,7 @@ class FTP:
        # 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]
index db3d1379b05f87e3c46fbe1606eb05858baabbab..f8b84e3ab0cefde8018ee7e1afa79e9aa12b7327 100644 (file)
@@ -94,6 +94,7 @@ class FrameWindow(basewin.BaseWindow):
                        output = ''
                else:
                        globals = self.frame.f_globals
+                       globals['__privileged__'] = 1
                        locals = self.dict
                        try:
                                value = eval(expr, globals, locals)
index db3d1379b05f87e3c46fbe1606eb05858baabbab..f8b84e3ab0cefde8018ee7e1afa79e9aa12b7327 100755 (executable)
@@ -94,6 +94,7 @@ class FrameWindow(basewin.BaseWindow):
                        output = ''
                else:
                        globals = self.frame.f_globals
+                       globals['__privileged__'] = 1
                        locals = self.dict
                        try:
                                value = eval(expr, globals, locals)
diff --git a/Lib/test/test_md5.py b/Lib/test/test_md5.py
new file mode 100644 (file)
index 0000000..43f12ca
--- /dev/null
@@ -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')