File: _common.py

package info (click to toggle)
python-typepy 1.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 624 kB
  • sloc: python: 2,886; makefile: 78; sh: 7
file content (15 lines) | stat: -rw-r--r-- 274 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""

import typepy


EXCEPTION_RESULT = "E"


def convert_wrapper(typeobj, method):
    try:
        return getattr(typeobj, method)()
    except typepy.TypeConversionError:
        return EXCEPTION_RESULT