Skip to content

Instantly share code, notes, and snippets.

View himanoa's full-sized avatar
🏠
Focusing uzi

himanoa himanoa

🏠
Focusing uzi
View GitHub Profile
# -*- coding: utf-8 -*-
from typing import *
from functools import wraps
def exception(f: Callable[[Any], Any]) -> Callable[[Any], Union[Exception, Any]]:
@wraps(f)
def wrapper(*args, **kwargs):
try:
return f(*args, **kwargs)
except Exception as e: