From 68f280814cb4862fb782ee6164c439e541ccbc37 Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Wed, 29 Dec 2010 13:56:13 +0200 Subject: [PATCH] Update _mechanize to hashlib and drop bundled subprocess and pyparsing --- setup.py | 2 +- twill/other_packages/_mechanize_dist/_auth.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8290fca..97e756b 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ setup(name = 'twill', author_email = 'titus@idyll.org', license='MIT', - packages = ['twill', 'twill.other_packages', + packages = ['twill', 'twill.other_packages._mechanize_dist', 'twill.extensions', 'twill.extensions.match_parse'], diff --git a/twill/other_packages/_mechanize_dist/_auth.py b/twill/other_packages/_mechanize_dist/_auth.py index 9bb5873..079956d 100644 --- a/twill/other_packages/_mechanize_dist/_auth.py +++ b/twill/other_packages/_mechanize_dist/_auth.py @@ -11,12 +11,17 @@ included with the distribution). """ -import re, base64, urlparse, posixpath, md5, sha, sys, copy +import re, base64, urlparse, posixpath, sys, copy from urllib2 import BaseHandler from urllib import getproxies, unquote, splittype, splituser, splitpasswd, \ splitport +try: + from hashlib import sha1 as sha, md5 +except ImportError: + import sha, md5 + def _parse_proxy(proxy): """Return (scheme, user, password, host/port) given a URL or an authority. -- 1.7.3.4