All you need to do is:
def get_passphrase():
"""Get passphrase from environment or, failing that, from user"""
try: return os.environ['PASSPHRASE']
except KeyError: pass
if not globals.encryption: return "" # assume we don't need passphrase
return "blarg"
The rest of the function would then no longer be necessary.

I don't have a clue as to what it means and I don't know anything
about Python.

Python is whitespace dependent. It cares about the number of spaces or
tabs at the beginning of each line as that is how it determines when a
function definition ends. The line that you changed should begin with
two tab characters.
Steven