diff options
author | Jason Madden <jamadden@gmail.com> | 2017-09-07 17:52:15 -0500 |
---|---|---|
committer | Jason Madden <jamadden@gmail.com> | 2017-09-08 06:29:27 -0500 |
commit | 8b01ecd553837b834d2e553e1198d841be380a9c (patch) | |
tree | 2d7a9d03f20b34dc38b87a3b414c9fdd8b00c5c4 /src/zope/security/_definitions.py | |
parent | ed4d2b755b0af0d27fcd26211115babe99dbe4ff (diff) | |
download | zope-security-8b01ecd553837b834d2e553e1198d841be380a9c.tar.gz |
Simplify _compat.py now that we only run on newer Pythons
- We have u'literals' so we don't need a _u() function.
For the record the Emacs replacement regex was
`_u(\(['"]\)\([^)]*\)\1) -> u\1\2\1`. Amazingly, I typed that right
on the first try.
A few things were only used in one (test) file or function, so it was
better to keep the use, if any, local and out of the "public" api:
- We can use io.StringIO everywhere and it's fast. It was only
imported in one file anyway.
- We can just import pickle. It was only imported in one file anyway.
- TEXT was only used in one test function, `type(u'')` is just as
clear (especially since the usual name is `text_type`).
- reload was only used in one test function, so move the definition
there.
Diffstat (limited to 'src/zope/security/_definitions.py')
-rw-r--r-- | src/zope/security/_definitions.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/zope/security/_definitions.py b/src/zope/security/_definitions.py index a54d7a8..e4f3867 100644 --- a/src/zope/security/_definitions.py +++ b/src/zope/security/_definitions.py @@ -17,12 +17,11 @@ import threading import zope.interface from zope.security import interfaces -from zope.security._compat import _u thread_local = threading.local() @zope.interface.provider(interfaces.IPrincipal) class system_user(object): - id = _u('zope.security.management.system_user') - title = _u('System') - description = _u('') + id = u'zope.security.management.system_user' + title = u'System' + description = u'' |