Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
96a50f6c
Commit
96a50f6c
authored
16 years ago
by
Yann Leboulanger
Browse files
Options
Downloads
Patches
Plain Diff
don't depend on python2.5 Fixes #3888
parent
a9e25aa9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/helpers.py
+14
-3
14 additions, 3 deletions
src/common/helpers.py
with
14 additions
and
3 deletions
src/common/helpers.py
+
14
−
3
View file @
96a50f6c
...
...
@@ -30,7 +30,6 @@ import urllib
import
errno
import
select
import
sha
import
hashlib
import
base64
import
sys
from
encodings.punycode
import
punycode_encode
...
...
@@ -42,6 +41,18 @@ from i18n import ngettext
from
xmpp_stringprep
import
nodeprep
,
resourceprep
,
nameprep
import
xmpp
try
:
# Python 2.5
import
hashlib
hash_md5
=
hashlib
.
md5
hash_sha1
=
hashlib
.
sha1
except
:
# Python 2.4
import
md5
import
sha
hash_md5
=
md5
.
new
hash_sha1
=
sha
.
new
if
sys
.
platform
==
'
darwin
'
:
from
osx
import
nsapp
...
...
@@ -1256,9 +1267,9 @@ def compute_caps_hash(identities, features, hash_method='sha-1'):
for
f
in
features
:
S
+=
'
%s<
'
%
f
if
hash_method
==
'
sha-1
'
:
hash
=
hash
lib
.
sha1
(
S
)
hash
=
hash
_
sha1
(
S
)
elif
hash_method
==
'
md5
'
:
hash
=
hash
lib
.
md5
(
S
)
hash
=
hash
_
md5
(
S
)
else
:
return
''
return
base64
.
b64encode
(
hash
.
digest
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment