Show More
@@ -744,6 +744,21 b' class _re(object):' | |||||
744 | pass |
|
744 | pass | |
745 | return remod.compile(pat, flags) |
|
745 | return remod.compile(pat, flags) | |
746 |
|
746 | |||
|
747 | @propertycache | |||
|
748 | def escape(self): | |||
|
749 | '''Return the version of escape corresponding to self.compile. | |||
|
750 | ||||
|
751 | This is imperfect because whether re2 or re is used for a particular | |||
|
752 | function depends on the flags, etc, but it's the best we can do. | |||
|
753 | ''' | |||
|
754 | global _re2 | |||
|
755 | if _re2 is None: | |||
|
756 | self._checkre2() | |||
|
757 | if _re2: | |||
|
758 | return re2.escape | |||
|
759 | else: | |||
|
760 | return remod.escape | |||
|
761 | ||||
747 | re = _re() |
|
762 | re = _re() | |
748 |
|
763 | |||
749 | _fspathcache = {} |
|
764 | _fspathcache = {} |
General Comments 0
You need to be logged in to leave comments.
Login now