diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-27 01:37:13 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-27 01:37:13 +0900 |
| commit | 4dd905605e866628e25e07202e7a2ce2ca6d463d (patch) | |
| tree | 58ff9bb5b7bd95495fab17f9d8c9834263a9ff7a /sphinx/pycode | |
| parent | df31bc3ac8ce22d395ad147c64a6f68f836085f2 (diff) | |
| download | sphinx-git-4dd905605e866628e25e07202e7a2ce2ca6d463d.tar.gz | |
Fix flake8 violations
Diffstat (limited to 'sphinx/pycode')
| -rw-r--r-- | sphinx/pycode/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index 6c8cd725e..c908b076e 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -9,11 +9,11 @@ """ import re +from importlib import import_module from io import StringIO from os import path from typing import Any, Dict, IO, List, Tuple, Optional from zipfile import ZipFile -from importlib import import_module from sphinx.errors import PycodeError from sphinx.pycode.parser import Parser @@ -114,7 +114,7 @@ class ModuleAnalyzer: try: filename, source = cls.get_module_source(modname) if source is not None: - obj = cls.for_string(source, modname, filename if filename is not None else '<string>') + obj = cls.for_string(source, modname, filename or '<string>') elif filename is not None: obj = cls.for_file(filename, modname) except PycodeError as err: |
