-
Notifications
You must be signed in to change notification settings - Fork 533
FIX: Mark strings containing regex escapes as raw #3106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -474,15 +474,16 @@ def _make_matlab_command(self, _): | |
script += "condnames=names;\n" | ||
else: | ||
if self.inputs.use_derivs: | ||
script += "pat = 'Sn\([0-9]*\) (.*)';\n" | ||
script += r"pat = 'Sn\([0-9]*\) (.*)';" "\n" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hopefully we test these. I'm less comfortable with these, since they need to work when written to MATLAB scripts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as long as we are still running the spm workflows. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codecov doesn't seem to hit them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tested: >>> a = ""
>>> a += r"\s+" "\nnextline"
>>> print(a)
\s+
nextline So rawstring/string concatenation works fine, and the Merging. |
||
else: | ||
script += ( | ||
"pat = 'Sn\([0-9]*\) (.*)\*bf\(1\)|Sn\([0-9]*\) " | ||
".*\*bf\([2-9]\)|Sn\([0-9]*\) (.*)';\n" | ||
r"pat = 'Sn\([0-9]*\) (.*)\*bf\(1\)|Sn\([0-9]*\) " | ||
r".*\*bf\([2-9]\)|Sn\([0-9]*\) (.*)';" | ||
"\n" | ||
) | ||
script += "t = regexp(names,pat,'tokens');\n" | ||
# get sessidx for columns | ||
script += "pat1 = 'Sn\(([0-9].*)\)\s.*';\n" | ||
script += r"pat1 = 'Sn\(([0-9].*)\)\s.*';" "\n" | ||
script += "t1 = regexp(names,pat1,'tokens');\n" | ||
script += ( | ||
"for i0=1:numel(t),condnames{i0}='';condsess(i0)=0;if " | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess I fixed another deprecation warning. This works for all Py3.