File: python_compatibility.py

package info (click to toggle)
moin 1.9.9-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 76,024 kB
  • sloc: python: 143,896; java: 10,704; php: 2,385; perl: 1,574; xml: 371; makefile: 214; sh: 81; sed: 5
file content (27 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
    MoinMoin - Support Package

    Was: Stuff for compatibility with Python < 2.7. Just a dummy now.

    @copyright: 2007 Heinrich Wendel <heinrich.wendel@gmail.com>,
                2009 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

import string

rsplit = string.rsplit

sorted = sorted

set = set
frozenset = frozenset

from functools import partial

import hashlib, hmac

hash_new = hashlib.new

def hmac_new(key, msg, digestmod=hashlib.sha1):
    return hmac.new(key, msg, digestmod)