[Calypso] [PATCH] Break endless loop
Guido Günther
agx at sigxcpu.org
Wed Jan 27 09:35:59 PST 2016
On Tue, Jan 26, 2016 at 08:25:47PM +0100, Guido Günther wrote:
> parent_url() always prefixes with a '/' so it can never be None. So
> check for that to unbreak the endless loop.
I have pushed that one since it unbreaks master. I'm still happy to hear
about any objections or a simple revert.
Cheers,
-- Guido
>
> This unbreaks calendars with Iceowl for me.
> ---
> calypso/paths.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/calypso/paths.py b/calypso/paths.py
> index bedc39d..429b901 100644
> --- a/calypso/paths.py
> +++ b/calypso/paths.py
> @@ -120,7 +120,7 @@ def resource_from_path(path):
> child_path = None
> collection = path
>
> - while collection and not is_collection(collection):
> + while collection != '/' and not is_collection(collection):
> child = child_url(collection)
> if child_path:
> child_path = child + "/" + child_path
> @@ -146,7 +146,7 @@ def collection_from_path(path):
> """Returns Calypso collection name from ``path``."""
>
> collection = path
> - while collection and not is_collection(collection):
> + while collection != '/' and not is_collection(collection):
> collection = parent_url(collection)
>
> if not collection:
> --
> 2.7.0.rc3
> _______________________________________________
> Calypso mailing list
> Calypso at keithp.com
> http://keithp.com/mailman/listinfo/calypso
More information about the Calypso
mailing list