Exec Inside DEF nie działa w Python

def better():
    d = {}
    exec("x=23", d)
    return d['x']

print better()
23
Sparkling Sable