From 604bde417bba86d4f184d3469e33f92e7fc8eed9 Mon Sep 17 00:00:00 2001 From: xuanyandong Date: Sun, 3 Jan 2021 15:59:18 +0800 Subject: [PATCH] remove unicode from code Change-Id: I062829a44a62014e88f285a82b6800e37f00ff28 --- doc/source/conf.py | 2 +- oslo_config/generator.py | 6 ++---- oslo_config/tests/test_get_location.py | 2 +- releasenotes/source/conf.py | 10 +++++----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 3535e209..975740fb 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -51,7 +51,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -copyright = u'2013, OpenStack Foundation' +copyright = '2013, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True diff --git a/oslo_config/generator.py b/oslo_config/generator.py index 9fdde09d..9845c814 100644 --- a/oslo_config/generator.py +++ b/oslo_config/generator.py @@ -288,11 +288,9 @@ class _OptFormatter: else: opt_help = opt.help - help_text = u'%s%s (%s)' % (opt_prefix, - opt_help, - opt_type) + help_text = '%s%s (%s)' % (opt_prefix, opt_help, opt_type) else: - help_text = u'(%s)' % opt_type + help_text = '(%s)' % opt_type lines = self._format_help(help_text) if getattr(opt.type, 'min', None) is not None: diff --git a/oslo_config/tests/test_get_location.py b/oslo_config/tests/test_get_location.py index 9541708c..d06271ae 100644 --- a/oslo_config/tests/test_get_location.py +++ b/oslo_config/tests/test_get_location.py @@ -137,7 +137,7 @@ class GetLocationTestCase(base.BaseTestCase): def _write_opt_to_tmp_file(self, group, option, value): filename = tempfile.mktemp() with io.open(filename, 'w', encoding='utf-8') as f: - f.write(textwrap.dedent(u''' + f.write(textwrap.dedent(''' [{group}] {option} = {value} ''').format( diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 92eb659e..8fd6fe92 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -60,7 +60,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -copyright = u'2016, oslo.config Developers' +copyright = '2016, oslo.config Developers' # Release notes do not need a version in the title, they span # multiple versions. @@ -196,8 +196,8 @@ html_static_path = ['_static'] # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'oslo.configreleasenotes', - u'oslo.config Release Notes Documentation', - [u'oslo.config Developers'], 1) + 'oslo.config Release Notes Documentation', + ['oslo.config Developers'], 1) ] # If true, show URL addresses after external links. @@ -211,8 +211,8 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ ('index', 'oslo.configReleaseNotes', - u'oslo.config Release Notes Documentation', - u'oslo.config Developers', 'oslo.configReleaseNotes', + 'oslo.config Release Notes Documentation', + 'oslo.config Developers', 'oslo.configReleaseNotes', 'An OpenStack library for parsing configuration options from the command' ' line and configuration files.', 'Miscellaneous'),