comparison utils/util_scripts/path.py @ 690:9dce3dbd4fa9

Applying patch to get rid of md5 warning message when running scons.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Tue, 19 Apr 2011 16:13:37 +0000
parents ea2c6960bbc8
children
comparison
equal deleted inserted replaced
689:f67e9f47526d 690:9dce3dbd4fa9
27 # - guess_content_type() method? 27 # - guess_content_type() method?
28 # - Perhaps support arguments to touch(). 28 # - Perhaps support arguments to touch().
29 29
30 from __future__ import generators 30 from __future__ import generators
31 31
32 import sys, warnings, os, fnmatch, glob, shutil, codecs, md5 32 import sys, warnings, os, fnmatch, glob, shutil, codecs
33
34 try:
35 # Python 2.5 or higher
36 from hashlib import md5
37 except ImportError:
38 # Python 2.4 or lower
39 from md5 import new as md5
33 40
34 __version__ = '2.2' 41 __version__ = '2.2'
35 __all__ = ['path'] 42 __all__ = ['path']
36 43
37 # Platform-specific support for path.owner 44 # Platform-specific support for path.owner
765 772
766 This reads through the entire file. 773 This reads through the entire file.
767 """ 774 """
768 f = self.open('rb') 775 f = self.open('rb')
769 try: 776 try:
770 m = md5.new() 777 m = md5()
771 while True: 778 while True:
772 d = f.read(8192) 779 d = f.read(8192)
773 if not d: 780 if not d:
774 break 781 break
775 m.update(d) 782 m.update(d)