From 07c7f946019edf25f1c32a1c6d4875e4fb3ec4e4 Mon Sep 17 00:00:00 2001 From: zhangtongjian <125163227@qq.com> Date: Mon, 4 Jan 2021 17:16:58 +0800 Subject: [PATCH] remove unicode from code Change-Id: I2d2d025b0d8bda2ffc7be4d30489728c05f53c8e --- doc/source/conf.py | 4 ++-- doc/source/using-api-v2.rst | 2 +- keystoneclient/discover.py | 14 +++++++------- keystoneclient/tests/unit/test_session.py | 2 +- keystoneclient/tests/unit/test_utils.py | 2 +- releasenotes/source/conf.py | 14 +++++++------- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index e74410dfe..f31dc2c1d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -186,8 +186,8 @@ apidoc_excluded_paths = [ # . latex_documents = [ ('index', 'doc-python-keystoneclient.tex', - u'python-keystoneclient Documentation', - u'OpenStack', 'manual'), + 'python-keystoneclient Documentation', + 'OpenStack', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of diff --git a/doc/source/using-api-v2.rst b/doc/source/using-api-v2.rst index 1b7c5deaf..7b0815f49 100644 --- a/doc/source/using-api-v2.rst +++ b/doc/source/using-api-v2.rst @@ -79,7 +79,7 @@ This example will create a tenant named *openstackDemo*:: >>> keystone = client.Client(...) >>> keystone.tenants.create(tenant_name="openstackDemo", ... description="Default Tenant", enabled=True) - + Creating users ============== diff --git a/keystoneclient/discover.py b/keystoneclient/discover.py index 0c129b3a0..16174162d 100644 --- a/keystoneclient/discover.py +++ b/keystoneclient/discover.py @@ -232,8 +232,8 @@ class Discover(_discover.Discover): >>> disc = discover.Discovery(auth_url='http://localhost:5000') >>> disc.raw_version_data() [{'id': 'v3.0', - 'links': [{'href': u'http://127.0.0.1:5000/v3/', - 'rel': u'self'}], + 'links': [{'href': 'http://127.0.0.1:5000/v3/', + 'rel': 'self'}], 'media-types': [ {'base': 'application/json', 'type': 'application/vnd.openstack.identity-v3+json'}, @@ -242,11 +242,11 @@ class Discover(_discover.Discover): 'status': 'stable', 'updated': '2013-03-06T00:00:00Z'}, {'id': 'v2.0', - 'links': [{'href': u'http://127.0.0.1:5000/v2.0/', - 'rel': u'self'}, - {'href': u'...', - 'rel': u'describedby', - 'type': u'application/pdf'}], + 'links': [{'href': 'http://127.0.0.1:5000/v2.0/', + 'rel': 'self'}, + {'href': '...', + 'rel': 'describedby', + 'type': 'application/pdf'}], 'media-types': [ {'base': 'application/json', 'type': 'application/vnd.openstack.identity-v2.0+json'}, diff --git a/keystoneclient/tests/unit/test_session.py b/keystoneclient/tests/unit/test_session.py index 14cfe3149..f201a0b8a 100644 --- a/keystoneclient/tests/unit/test_session.py +++ b/keystoneclient/tests/unit/test_session.py @@ -243,7 +243,7 @@ class SessionTests(utils.TestCase): session = client_session.Session(verify=False) body = 'RESP' - data = u'αβγδ' + data = 'αβγδ' self.stub_url('POST', text=body) session.post(self.TEST_URL, data=data) diff --git a/keystoneclient/tests/unit/test_utils.py b/keystoneclient/tests/unit/test_utils.py index 01443314c..c1f6f8c93 100644 --- a/keystoneclient/tests/unit/test_utils.py +++ b/keystoneclient/tests/unit/test_utils.py @@ -33,7 +33,7 @@ class FakeManager(object): resources = { '1234': {'name': 'entity_one'}, '8e8ec658-c7b0-4243-bdf8-6f7f2952c0d0': {'name': 'entity_two'}, - '\xe3\x82\xbdtest': {'name': u'\u30bdtest'}, + '\xe3\x82\xbdtest': {'name': '\u30bdtest'}, '5678': {'name': '9876'} } diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index dc65fbe4a..f2ae6a44e 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -54,7 +54,7 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -copyright = u'2015, Keystone Developers' +copyright = '2015, Keystone Developers' # Release notes are version independent. # The full version, including alpha/beta/rc tags. @@ -189,8 +189,8 @@ htmlhelp_basename = 'KeystoneClientReleaseNotesdoc' # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'keystoneclientReleaseNotes.tex', - u'keystoneclient Release Notes Documentation', - u'Keystone Developers', 'manual'), + 'keystoneclient Release Notes Documentation', + 'Keystone Developers', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -220,8 +220,8 @@ latex_documents = [ # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'keystoneclientreleasenotes', - u'keystoneclient Release Notes Documentation', - [u'Keystone Developers'], 1) + 'keystoneclient Release Notes Documentation', + ['Keystone Developers'], 1) ] # If true, show URL addresses after external links. @@ -235,8 +235,8 @@ man_pages = [ # dir menu entry, description, category) texinfo_documents = [ ('index', 'keystoneclientReleaseNotes', - u'keystoneclient Release Notes Documentation', - u'Keystone Developers', 'keystoneclientReleaseNotes', + 'keystoneclient Release Notes Documentation', + 'Keystone Developers', 'keystoneclientReleaseNotes', 'Python bindings for the OpenStack Identity service.', 'Miscellaneous'), ]