Skip to content

Python 2.4 (small) issue (module is callable error) #54

@gnotaras

Description

@gnotaras

There is an error when this module runs in python 2.4. I put a small patch inline here because github won't let me attach files:

diff -r 89426279318c -r ea8401431426 oauth2/__init__.py
--- a/oauth2/__init__.py    Mon Feb 14 21:35:07 2011 +0200
+++ b/oauth2/__init__.py    Mon Feb 14 21:36:07 2011 +0200
@@ -471,7 +471,7 @@
             # section 4.1.1 "OAuth Consumers MUST NOT include an
             # oauth_body_hash parameter on requests with form-encoded
             # request bodies."
-            self['oauth_body_hash'] = base64.b64encode(sha(self.body).digest())
+            self['oauth_body_hash'] = base64.b64encode(sha.new(self.body).digest())
 
         if 'oauth_consumer_key' not in self:
             self['oauth_consumer_key'] = consumer.key

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions