Remove unnecessary unicode prefixes

All strings are unicode by default in Python 3. No need to mark them as
such.

Change-Id: I506a7bcd8fb3de2088bf37ebbb117896de9ddc77
This commit is contained in:
songwenping
2022-04-19 15:11:53 +08:00
parent 73610db919
commit fa16f4dc6e
4 changed files with 18 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
copyright = u'2014, OpenStack Foundation' copyright = '2014, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True add_function_parentheses = True

View File

@@ -72,7 +72,7 @@ class TestSerialization(base.BaseTestCase):
self.assertSendable(data) self.assertSendable(data)
def test_unicode(self): def test_unicode(self):
data = u'\u4e09\u9df9\udc82' data = '\u4e09\u9df9\udc82'
self.assertSendable(data) self.assertSendable(data)
def test_tuple(self): def test_tuple(self):

View File

@@ -95,15 +95,15 @@ class LogTest(testctx.TestContextTestCase):
level=logging.INFO)) level=logging.INFO))
# These write to the log on the priv side # These write to the log on the priv side
logme(logging.DEBUG, u'test@DEBUG') logme(logging.DEBUG, 'test@DEBUG')
logme(logging.WARN, u'test@WARN') logme(logging.WARN, 'test@WARN')
time.sleep(0.1) # Hack to give logging thread a chance to run time.sleep(0.1) # Hack to give logging thread a chance to run
# logger.output is the resulting log on the unpriv side. # logger.output is the resulting log on the unpriv side.
# This should have been filtered based on (unpriv) loglevel. # This should have been filtered based on (unpriv) loglevel.
self.assertNotIn(u'test@DEBUG', logger.output) self.assertNotIn('test@DEBUG', logger.output)
self.assertIn(u'test@WARN', logger.output) self.assertIn('test@WARN', logger.output)
def test_record_data(self): def test_record_data(self):
logs = [] logs = []
@@ -114,19 +114,19 @@ class LogTest(testctx.TestContextTestCase):
# class/function, not an instance :( # class/function, not an instance :(
formatter=functools.partial(LogRecorder, logs))) formatter=functools.partial(LogRecorder, logs)))
logme(logging.WARN, u'test with exc', exc_info=True) logme(logging.WARN, 'test with exc', exc_info=True)
time.sleep(0.1) # Hack to give logging thread a chance to run time.sleep(0.1) # Hack to give logging thread a chance to run
self.assertEqual(1, len(logs)) self.assertEqual(1, len(logs))
record = logs[0] record = logs[0]
self.assertIn(u'test with exc', record.getMessage()) self.assertIn('test with exc', record.getMessage())
self.assertIsNone(record.exc_info) self.assertIsNone(record.exc_info)
self.assertIn(u'TestException: with arg', record.exc_text) self.assertIn('TestException: with arg', record.exc_text)
self.assertEqual('PrivContext(cfg_section=privsep)', self.assertEqual('PrivContext(cfg_section=privsep)',
record.processName) record.processName)
self.assertIn(u'test_daemon.py', record.exc_text) self.assertIn('test_daemon.py', record.exc_text)
self.assertEqual(logging.WARN, record.levelno) self.assertEqual(logging.WARN, record.levelno)
self.assertEqual('logme', record.funcName) self.assertEqual('logme', record.funcName)
@@ -139,7 +139,7 @@ class LogTest(testctx.TestContextTestCase):
# class/function, not an instance :( # class/function, not an instance :(
formatter=functools.partial(LogRecorder, logs))) formatter=functools.partial(LogRecorder, logs)))
logme(logging.WARN, u'test with exc', exc_info=True) logme(logging.WARN, 'test with exc', exc_info=True)
time.sleep(0.1) # Hack to give logging thread a chance to run time.sleep(0.1) # Hack to give logging thread a chance to run

View File

@@ -59,7 +59,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
copyright = u'2016, oslo.privsep Developers' copyright = '2016, oslo.privsep Developers'
# Release notes do not need a version in the title, they span # Release notes do not need a version in the title, they span
# multiple versions. # multiple versions.
@@ -199,8 +199,8 @@ htmlhelp_basename = 'oslo.privsepReleaseNotesDoc'
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
('index', 'oslo.privsepReleaseNotes.tex', ('index', 'oslo.privsepReleaseNotes.tex',
u'oslo.privsep Release Notes Documentation', 'oslo.privsep Release Notes Documentation',
u'oslo.privsep Developers', 'manual'), 'oslo.privsep Developers', 'manual'),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
@@ -230,8 +230,8 @@ latex_documents = [
# (source start file, name, description, authors, manual section). # (source start file, name, description, authors, manual section).
man_pages = [ man_pages = [
('index', 'oslo.privsepReleaseNotes', ('index', 'oslo.privsepReleaseNotes',
u'oslo.privsep Release Notes Documentation', 'oslo.privsep Release Notes Documentation',
[u'oslo.privsep Developers'], 1) ['oslo.privsep Developers'], 1)
] ]
# If true, show URL addresses after external links. # If true, show URL addresses after external links.
@@ -245,8 +245,8 @@ man_pages = [
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
('index', 'oslo.privsepReleaseNotes', ('index', 'oslo.privsepReleaseNotes',
u'oslo.privsep Release Notes Documentation', 'oslo.privsep Release Notes Documentation',
u'oslo.privsep Developers', 'oslo.privsepReleaseNotes', 'oslo.privsep Developers', 'oslo.privsepReleaseNotes',
'OpenStack library for privilege separation.', 'OpenStack library for privilege separation.',
'Miscellaneous'), 'Miscellaneous'),
] ]