Declare types for BasedirOptions. Fixes several errors.

This commit is contained in:
Jason R. Coombs 2020-11-29 14:32:34 -05:00
parent e9ddcf5911
commit 1248d65778
1 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,11 @@ import os, sys, urllib, textwrap
import codecs
from os.path import join
try:
from typing import Optional, Sequence, List
except ImportError:
pass
# Python 2 compatibility
from future.utils import PY2
if PY2:
@ -64,7 +69,7 @@ class BasedirOptions(BaseOptions):
optParameters = [
["basedir", "C", None, "Specify which Tahoe base directory should be used. [default: %s]"
% quote_local_unicode_path(_default_nodedir)],
]
] # type: List[Sequence[Optional[str]]]
def parseArgs(self, basedir=None):
# This finds the node-directory option correctly even if we are in a subcommand.