diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-03-17 12:49:36 -0700 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-03-19 01:09:48 +0900 |
commit | 22afc77c488e85ccd51303a223f450705b30217b (patch) | |
tree | ff1d15cd398cc399ff667befc3af59d82d45a9db /sphinx/cmd/quickstart.py | |
parent | 33ba281e0a45467bace85229180c0673eaa98415 (diff) | |
download | sphinx-git-22afc77c488e85ccd51303a223f450705b30217b.tar.gz |
Python-3-only clean ups discovered by pyupgrade
https://github.com/asottile/pyupgrade
> A tool to automatically upgrade syntax for newer versions of the
> language.
- Drop u str prefix
- Drop base object inheritance
- Drop args to super()
- Use set literals
- Use dict comprehension
- Use set comprehension
Diffstat (limited to 'sphinx/cmd/quickstart.py')
-rw-r--r-- | sphinx/cmd/quickstart.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index c8b1b4fdd..dfc096de5 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -349,8 +349,7 @@ document is a custom template, you can also set this to another filename.''')) d['extensions'].append('sphinx.ext.%s' % name) # Handle conflicting options - if set(['sphinx.ext.imgmath', 'sphinx.ext.mathjax']).issubset( - d['extensions']): + if {'sphinx.ext.imgmath', 'sphinx.ext.mathjax'}.issubset(d['extensions']): print(__('Note: imgmath and mathjax cannot be enabled at the same ' 'time. imgmath has been deselected.')) d['extensions'].remove('sphinx.ext.imgmath') @@ -469,7 +468,7 @@ def valid_dir(d): if not path.isdir(dir): return False - if set(['Makefile', 'make.bat']) & set(os.listdir(dir)): + if {'Makefile', 'make.bat'} & set(os.listdir(dir)): return False if d['sep']: @@ -590,7 +589,7 @@ def main(argv=sys.argv[1:]): d = vars(args) # delete None or False value - d = dict((k, v) for k, v in d.items() if v is not None) + d = {k: v for k, v in d.items() if v is not None} # handle use of CSV-style extension values d.setdefault('extensions', []) @@ -601,12 +600,12 @@ def main(argv=sys.argv[1:]): try: if 'quiet' in d: - if not set(['project', 'author']).issubset(d): + if not {'project', 'author'}.issubset(d): print(__('''"quiet" is specified, but any of "project" or \ "author" is not specified.''')) return 1 - if set(['quiet', 'project', 'author']).issubset(d): + if {'quiet', 'project', 'author'}.issubset(d): # quiet mode with all required params satisfied, use default d.setdefault('version', '') d.setdefault('release', d['version']) |