From 3d625436fc5284c38fcfe054396d98dcb7495a0d Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 28 Feb 2010 17:06:24 +0100 Subject: fixed __nonzero__ compatibility problem __nonzero__ was renamed to __bool__ in python3 --- ranger/fsobject/directory.py | 1 + ranger/gui/displayable.py | 1 + 2 files changed, 2 insertions(+) diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index eebe6f03..5bbbe3e4 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -391,6 +391,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): def __nonzero__(self): """Always True""" return True + __bool__ = __nonzero__ def __len__(self): """The number of containing files""" diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py index 53dc7abe..ceefb3f1 100644 --- a/ranger/gui/displayable.py +++ b/ranger/gui/displayable.py @@ -84,6 +84,7 @@ class Displayable(EnvironmentAware, FileManagerAware, CursesShortcuts): def __nonzero__(self): """Always True""" return True + __bool__ = __nonzero__ def __contains__(self, item): """ -- cgit 1.4.1-2-gfad0