You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2020/08/05 18:45:19 UTC
[cassandra] branch trunk updated: Make cqlsh tests with with Python
3.7 re changes
This is an automated email from the ASF dual-hosted git repository.
brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push:
new f93c563 Make cqlsh tests with with Python 3.7 re changes
f93c563 is described below
commit f93c5631636020cd3fa1f39d0ac92959102bd5eb
Author: Adam Holmberg <ad...@datastax.com>
AuthorDate: Wed Aug 5 13:18:43 2020 -0500
Make cqlsh tests with with Python 3.7 re changes
Patch by Adam Holmberg, reviewed by brandonwilliams for CASSANDRA-16028
---
pylib/cqlshlib/test/run_cqlsh.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/pylib/cqlshlib/test/run_cqlsh.py b/pylib/cqlshlib/test/run_cqlsh.py
index 1c90d58..2d0931c 100644
--- a/pylib/cqlshlib/test/run_cqlsh.py
+++ b/pylib/cqlshlib/test/run_cqlsh.py
@@ -43,6 +43,12 @@ else:
DEFAULT_CQLSH_PROMPT = DEFAULT_PREFIX + '(\S+@)?cqlsh(:\S+)?> '
DEFAULT_CQLSH_TERM = 'xterm'
+try:
+ Pattern = re._pattern_type
+except AttributeError:
+ # Python 3.7+
+ Pattern = re.Pattern
+
def get_smm_sequence(term='xterm'):
"""
Return the set meta mode (smm) sequence, if any.
@@ -218,7 +224,7 @@ class ProcRunner:
def read_until(self, until, blksize=4096, timeout=None,
flags=0, ptty_timeout=None, replace=[]):
- if not isinstance(until, re._pattern_type):
+ if not isinstance(until, Pattern):
until = re.compile(until, flags)
cqlshlog.debug("Searching for %r" % (until.pattern,))
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org