class EmptyIterableException(Exception):
    pass

def wrapper(iterable):
    for each in iterable:
        yield each
raise EmptyIterableException('Empty')
try:
    for each in wrapper(iterable):
        do_something(each)
except EmptyIterableException as e:
    do_something_else()
Idiomatic way of taking action on attempt to loop over an empty iterable