[PATCH] D62882: Use raw strings to avoid deprecation warnings in regexp patterns

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 10:49:18 PDT 2019


amccarth added a comment.

In D62882#1530159 <https://reviews.llvm.org/D62882#1530159>, @jdenny wrote:

> But how do I see the bad behavior or deprecation warnings?  Python 3.6.7 with `-ddd` didn't reveal anything on a simple example I just tried.


I see the deprecation warnings when running the LLDB tests on Windows, which selects the debug version of Python 3.6.7.

I don't think other LLVM tests are run with the debug version of Python, so the warnings do not show.  My larger goal here is the clean up the Windows LLDB test output so we can see the real problems and fix enough of them to make it reasonable to run the tests on some (more?) the Windows bots.

Thanks for the review.



================
Comment at: llvm/utils/lit/lit/TestRunner.py:52
 # during expansion.
-kPdbgRegex = '%dbg\(([^)\'"]*)\)'
+kPdbgRegex = r'%dbg\(([^)\'"]*)\)'
 
----------------
jdenny wrote:
> The fact that `\'` will remain as `\'` bugs me because the `'` need not be escaped as part of the regex.  Hopefully that won't be deprecated one day.
Would you prefer the following?

    kPdbgRegex = '%dbg\\(([^)\'"]*)\\)'

(It's kind of disappointing the Python raw string literals aren't always the best choice.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62882/new/

https://reviews.llvm.org/D62882





More information about the llvm-commits mailing list