File: plain_old_module.py

package info (click to toggle)
python-mitogen 0.3.34-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,696 kB
  • sloc: python: 24,298; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (28 lines) | stat: -rwxr-xr-x 438 bytes parent folder | download
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
28
"""
I am a plain old module with no interesting dependencies or import machinery
fiddlery.
"""

import math


class MyError(Exception):
    pass


def get_sentinel_value():
    # Some proof we're even talking to the mitogen-test Docker image
    f = open('/etc/sentinel', 'rb')
    try:
        value = f.read().decode()
    finally:
        f.close()
    return value


def add(x, y):
    return x + y


def pow(x, y):
    return x ** y