From: Nathan Cutler Date: Fri, 6 Jul 2018 22:47:34 +0000 (+0200) Subject: tests: make test_ceph_argparse.py pass on py3-only systems X-Git-Tag: v13.2.1~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22988%2Fhead;p=ceph.git tests: make test_ceph_argparse.py pass on py3-only systems On systems that do not have Python 2 installed, this test fails to import StringIO. Fixes: http://tracker.ceph.com/issues/24816 Signed-off-by: Nathan Cutler (cherry picked from commit 5ed075d77f2be7aba6ae011b67a7cf9e3cd7d321) --- diff --git a/src/test/pybind/test_ceph_argparse.py b/src/test/pybind/test_ceph_argparse.py index d1769f714891..55e04c231d7b 100755 --- a/src/test/pybind/test_ceph_argparse.py +++ b/src/test/pybind/test_ceph_argparse.py @@ -24,7 +24,10 @@ import os import re import sys import json -from StringIO import StringIO +try: + from StringIO import StringIO +except ImportError: + from io import StringIO def get_command_descriptions(what): CEPH_BIN = os.environ['CEPH_BIN']