From 3d3aaf9a896dfac3f29693b6c7fea61c494e4fce Mon Sep 17 00:00:00 2001 From: Vitaly Haritonsky Date: Thu, 9 Jan 2020 14:32:36 +0200 Subject: python3 compatibility issues: list + keys concatenation, bool check (#42) --- paste/registry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'paste') diff --git a/paste/registry.py b/paste/registry.py index 908bc0d..e218e03 100644 --- a/paste/registry.py +++ b/paste/registry.py @@ -125,7 +125,7 @@ class StackedObjectProxy(object): """Return a list of the StackedObjectProxy's and proxied object's (if one exists) names. """ - dir_list = dir(self.__class__) + self.__dict__.keys() + dir_list = dir(self.__class__) + list(self.__dict__.keys()) try: dir_list.extend(dir(self._current_obj())) except TypeError: @@ -165,6 +165,9 @@ class StackedObjectProxy(object): def __iter__(self): return iter(self._current_obj()) + def __bool__(self): + return bool(self._current_obj()) + def __len__(self): return len(self._current_obj()) -- cgit v1.2.1