diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-05-02 08:48:32 -0400 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-05-30 03:37:46 +0000 |
commit | 202d27c5309f2b5a2c4cda4af2e9a1ec85e1e9ad (patch) | |
tree | 80434465328987f4bde5a57e16bbff76ccf9f555 /xlators/features/glupy | |
parent | 7e72af7657973d508c179922bd29257ff8402bcd (diff) |
core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/ and
https://review.gluster.org/#/c/19871/
Selected small fixes from 2to3 utility. Specifically apply, basestring,
funcattrs, idioms, numliterals, set_literal, types, urllib, zip
Note: these 2to3 fixes report no changes are necessary: exec, execfile,
exitfunc, filter, getcwdu, intern, itertools, metaclass, methodattrs, ne,
next, nonzero, operator, paren, raw_input, reduce, reload, renames, repr,
standarderror, sys_exc, throw, tuple_params, xreadlines.
Any 2to3 fixes not in the above two lists have more extensive changes
which will follow in separate patches.
most unicode changes suggested by 2to3 will need to be applied at the
same time as changing the shebangs from python2 to python3. Prashanth
notes that unicode strings in py2 need 'u' prefix; unicode strings in
py3 3.0, 3.1, and 3.2 a 'u' prefix will throw an error, but in py3 3.3+
it is legal (or just ignored). All Linux dists we care about have 3.3
or later so we can leave 'u' prefixes on unicode strings.
Change-Id: I49bba2f328b0ee24b9a8115a7183be979981563e
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/features/glupy')
-rw-r--r-- | xlators/features/glupy/examples/negative.py | 2 | ||||
-rw-r--r-- | xlators/features/glupy/src/glupy/__init__.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/xlators/features/glupy/examples/negative.py b/xlators/features/glupy/examples/negative.py index e44ff4deed2..543f3109502 100644 --- a/xlators/features/glupy/examples/negative.py +++ b/xlators/features/glupy/examples/negative.py @@ -62,7 +62,7 @@ class xlator (Translator): if cache.has_key(pargfid): cache[pargfid].add(name) else: - cache[pargfid] = set([name]) + cache[pargfid] = {name} del self.requests[key] dl.unwind_lookup(frame,cookie,this,op_ret,op_errno, inode,buf,xdata,postparent) diff --git a/xlators/features/glupy/src/glupy/__init__.py b/xlators/features/glupy/src/glupy/__init__.py index b9fc3700fa6..16ff3101de8 100644 --- a/xlators/features/glupy/src/glupy/__init__.py +++ b/xlators/features/glupy/src/glupy/__init__.py @@ -240,8 +240,8 @@ def _init_op (a_class, fop, cbk, wind, unwind): # Decorators, used by translators. We could pass the signatures as # parameters, but it's actually kind of nice to keep them around for # inspection. - a_class.fop_type = apply(CFUNCTYPE,a_class.fop_sig) - a_class.cbk_type = apply(CFUNCTYPE,a_class.cbk_sig) + a_class.fop_type = CFUNCTYPE(*a_class.fop_sig) + a_class.cbk_type = CFUNCTYPE(*a_class.cbk_sig) # Dispatch-function registration. fop.restype = None fop.argtypes = [ c_long, a_class.fop_type ] |