File: _common.py

package info (click to toggle)
python-typepy 1.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 600 kB
  • sloc: python: 2,787; makefile: 75; sh: 7
file content (15 lines) | stat: -rw-r--r-- 276 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