Merge pull request #47403 from rallytime/bp-47356

Back-port #47356 to 2018.3
This commit is contained in:
Mike Place 2018-05-01 10:19:05 -05:00 committed by GitHub
commit 4e6870305c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,13 +129,10 @@ def assign(name, value):
tran_tab = name.translate(''.maketrans('./', '/.'))
else:
if isinstance(name, unicode): # pylint: disable=incompatible-py3-code
trans_args = ({
ord('/'): '.',
ord('.'): '/'
},)
trans_args = {ord('/'): u'.', ord('.'): u'/'}
else:
trans_args = string.maketrans('./', '/.')
tran_tab = name.translate(*trans_args)
tran_tab = name.translate(trans_args)
sysctl_file = '/proc/sys/{0}'.format(tran_tab)
if not os.path.exists(sysctl_file):