diff options
Diffstat (limited to 'xlators/features/changelog/lib/examples/python')
| -rwxr-xr-x[-rw-r--r--] | xlators/features/changelog/lib/examples/python/changes.py | 13 | ||||
| -rw-r--r-- | xlators/features/changelog/lib/examples/python/libgfchangelog.py | 3 |
2 files changed, 9 insertions, 7 deletions
diff --git a/xlators/features/changelog/lib/examples/python/changes.py b/xlators/features/changelog/lib/examples/python/changes.py index 221df642a36..c410d3b000d 100644..100755 --- a/xlators/features/changelog/lib/examples/python/changes.py +++ b/xlators/features/changelog/lib/examples/python/changes.py @@ -1,5 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 +from __future__ import print_function import os import sys import time @@ -16,18 +17,18 @@ def get_changes(brick, scratch_dir, log_file, log_level, interval): cl.cl_scan() change_list = cl.cl_getchanges() if change_list: - print change_list + print(change_list) for change in change_list: - print('done with %s' % (change)) + print(('done with %s' % (change))) cl.cl_done(change) time.sleep(interval) except OSError: ex = sys.exc_info()[1] - print ex + print(ex) if __name__ == '__main__': if len(sys.argv) != 6: - print("usage: %s <brick> <scratch-dir> <log-file> <fetch-interval>" - % (sys.argv[0])) + print(("usage: %s <brick> <scratch-dir> <log-file> <fetch-interval>" + % (sys.argv[0]))) sys.exit(1) get_changes(sys.argv[1], sys.argv[2], sys.argv[3], 9, int(sys.argv[4])) diff --git a/xlators/features/changelog/lib/examples/python/libgfchangelog.py b/xlators/features/changelog/lib/examples/python/libgfchangelog.py index 10e73c02b34..2da9f2d2a8c 100644 --- a/xlators/features/changelog/lib/examples/python/libgfchangelog.py +++ b/xlators/features/changelog/lib/examples/python/libgfchangelog.py @@ -3,7 +3,8 @@ from ctypes import * from ctypes.util import find_library class Changes(object): - libgfc = CDLL(find_library("gfchangelog"), mode=RTLD_GLOBAL, use_errno=True) + libgfc = CDLL(find_library("gfchangelog"), mode=RTLD_GLOBAL, + use_errno=True) @classmethod def geterrno(cls): |
