You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2022/06/29 18:46:24 UTC
[allura] 01/02: clean up some py2-only special methods
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
commit cfcde7880391d3236f25c760e9fd75ad60abeadb
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Wed Jun 29 14:43:50 2022 -0400
clean up some py2-only special methods
---
Allura/allura/lib/utils.py | 2 --
Allura/allura/model/repository.py | 7 ++-----
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/Allura/allura/lib/utils.py b/Allura/allura/lib/utils.py
index 4edd6b55c..63045c259 100644
--- a/Allura/allura/lib/utils.py
+++ b/Allura/allura/lib/utils.py
@@ -405,8 +405,6 @@ class TruthyCallable:
def __bool__(self):
return self.callable()
- __nonzero__ = __bool__ # python 2
-
class TransformedDict(collections.MutableMapping):
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 24543ff59..0c2239ccc 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -1569,9 +1569,6 @@ class EmptyBlob(Blob):
def size(self):
return 0
- def __nonzero__(self):
- return False
-
def __bool__(self):
return False
@@ -1933,7 +1930,7 @@ class GitLikeTree:
for name, oid in self.blobs.items()]
return six.ensure_str('\n'.join(sorted(lines)))
- def __unicode__(self):
+ def __str__(self):
return self.pretty_tree(recurse=False)
def pretty_tree(self, indent=0, recurse=True, show_id=True):
@@ -1944,7 +1941,7 @@ class GitLikeTree:
for name, t in sorted(self.trees.items())]
lines += [' ' * indent + 'b {} {}'.format(name, oid if show_id else '')
for name, oid in sorted(self.blobs.items())]
- output = h.really_unicode('\n'.join(lines)).encode('utf-8')
+ output = h.really_unicode('\n'.join(lines))
return output