I'm pretty new to Python still, so I'm trying to figure out how to do this and need some help.

I use return codes to verify that my internal functions return successfully. For example (from internal library functions):

```
result = some_function(arg1,arg2)
if result != OK: return result

```

or (from main script level):

```
result = some_function(arg1,arg2)
if result != OK: abort_on_error("Could not complete 'some_function': %s" % messages(result))

```

Can I get this down to one line without making it unreadable?

EDIT: Some people are recognizing that exceptions might be a better choice. I wanted to save exceptions only for very 'exceptional' scenario capturing. The return codes may be expected to fail at times, and I thought it was generally bad practice to use exceptions for this scenario.