summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/utils/syncdaemon/syncdutils.py
diff options
context:
space:
mode:
authorCsaba Henk <csaba@gluster.com>2011-08-10 20:04:20 +0300
committerVijay Bellur <vijay@gluster.com>2011-09-12 06:20:42 -0700
commite139eeeb627368112aa1341d2f0ef6770dd7078e (patch)
tree6473a0e0f163b7e3e4057798864286f6f0c517d2 /xlators/features/marker/utils/syncdaemon/syncdutils.py
parentf3081a22740c70485c50d3837fa93da5fd843f26 (diff)
gsyncd: python3 compat fixes
Also add __codecheck script which can verify if source is OK at the syntactical level with a given Python interpreter. Change-Id: Ieff34bcd3efd1cdc0e8f9a510c05488f35897bbe BUG: 1570 Reviewed-on: http://review.gluster.com/320 Reviewed-by: Kaushik BV <kaushikbv@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/marker/utils/syncdaemon/syncdutils.py')
-rw-r--r--xlators/features/marker/utils/syncdaemon/syncdutils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/xlators/features/marker/utils/syncdaemon/syncdutils.py b/xlators/features/marker/utils/syncdaemon/syncdutils.py
index 244e29628e0..6a08fbdaf9a 100644
--- a/xlators/features/marker/utils/syncdaemon/syncdutils.py
+++ b/xlators/features/marker/utils/syncdaemon/syncdutils.py
@@ -8,7 +8,11 @@ from threading import Lock, Thread as baseThread
from errno import EACCES, EAGAIN, EPIPE, ENOTCONN
from signal import SIGTERM, SIGKILL
from time import sleep
-from cPickle import PickleError
+try:
+ from cPickle import PickleError
+except ImportError:
+ # py 3
+ from pickle import PickleError
from gconf import gconf
@@ -184,7 +188,7 @@ class FreeObject(object):
"""wildcard class for which any attribute can be set"""
def __init__(self, **kw):
- for k,v in kw.iteritems():
+ for k,v in kw.items():
setattr(self, k, v)
class Thread(baseThread):
@@ -210,5 +214,5 @@ class Thread(baseThread):
baseThread.__init__(self, *a, **kw)
self.setDaemon(True)
-class GsyncdError(StandardError):
+class GsyncdError(Exception):
pass