Make getattr more simpler

```
try:
  stack = self._local.stack
  return stack
except AttributeError:
  return []
```

Is a bit more idiomatic and it does not create a new list when it is not needed.