File: _compat2x.py

package info (click to toggle)
python-testtools 1.8.0-3~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,204 kB
  • sloc: python: 12,239; makefile: 130; sh: 2
file content (17 lines) | stat: -rw-r--r-- 468 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Copyright (c) 2011 testtools developers. See LICENSE for details.

"""Compatibility helpers that are valid syntax in Python 2.x.

Only add things here if they *only* work in Python 2.x or are Python 2
alternatives to things that *only* work in Python 3.x.
"""

__all__ = [
    'reraise',
    ]


def reraise(exc_class, exc_obj, exc_tb, _marker=object()):
    """Re-raise an exception received from sys.exc_info() or similar."""
    raise exc_class, exc_obj, exc_tb