From 6ea9003436e79163a865a0a30b6051f7811c1bd3 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 29 Nov 2020 15:19:11 -0500 Subject: [PATCH] Declare MultiFormatResource.formatDefault as optional string for subclass overrides. --- src/allmydata/web/common_py3.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/allmydata/web/common_py3.py b/src/allmydata/web/common_py3.py index 22f235790..080c24c19 100644 --- a/src/allmydata/web/common_py3.py +++ b/src/allmydata/web/common_py3.py @@ -4,6 +4,11 @@ Common utilities that are available from Python 3. Can eventually be merged back into allmydata.web.common. """ +try: + from typing import Optional +except ImportError: + pass + from twisted.web import resource, http from allmydata.util import abbreviate @@ -47,7 +52,7 @@ class MultiFormatResource(resource.Resource, object): format if nothing else is given as the ``formatDefault``. """ formatArgument = "t" - formatDefault = None + formatDefault = None # type: Optional[str] def render(self, req): """