changeset 30493:d1b97fc87f55

httppeer: document why super() isn't used Adding a follow-up to document lack of super() per Augie's request.
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Nov 2016 20:12:51 -0800
parents 8491845a75b2
children acd30a959980
files mercurial/httppeer.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/httppeer.py	Thu Nov 17 00:59:41 2016 -0800
+++ b/mercurial/httppeer.py	Mon Nov 21 20:12:51 2016 -0800
@@ -39,6 +39,9 @@
 
     # We need to wrap reader.read() so HTTPException on subsequent
     # reads is also converted.
+    # Ideally we'd use super() here. However, if ``reader`` isn't a new-style
+    # class, this can raise:
+    # TypeError: super() argument 1 must be type, not classobj
     origread = reader.read
     class readerproxy(reader.__class__):
         def read(self, *args, **kwargs):