Skip to content

Commit 4486c69

Browse files
authored
Merge pull request #57 from remlapmot/fix-warning-raw-strs-pr
Fix SyntaxWarning when running kernel install script in Python 3.12+
2 parents 07ad511 + a769d7c commit 4486c69

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

nbs/04_code_utils.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@
850850
" code = _replace_delimiter(code, sc_delimiter) \n",
851851
" \n",
852852
" # Replace multiple interior whitespace with one\n",
853-
" code = multi_regex.sub('\\g<char> ',code)\n",
853+
" code = multi_regex.sub(r'\\g<char> ',code)\n",
854854
" \n",
855855
" # Delete blank lines and whitespace at end of lines\n",
856856
" code_lines = code.splitlines()\n",

nbs/09_magics.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@
11001100
"#| export\n",
11011101
"@patch_to(StataMagics)\n",
11021102
"def magic_help(self, code, kernel, cell):\n",
1103-
" \"\"\"Show help file from stata.com/help.cgi?\\{\\}\"\"\"\n",
1103+
" r\"\"\"Show help file from stata.com/help.cgi?{}\"\"\"\n",
11041104
" try:\n",
11051105
" html_help = self._get_help_html(code)\n",
11061106
" except Exception as e: # original: (urllib.error.HTTPError, urllib.error.URLError)\n",

nbstata/code_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def standardize_code(code, sc_delimiter=False):
118118
code = _replace_delimiter(code, sc_delimiter)
119119

120120
# Replace multiple interior whitespace with one
121-
code = multi_regex.sub('\g<char> ',code)
121+
code = multi_regex.sub(r'\g<char> ',code)
122122

123123
# Delete blank lines and whitespace at end of lines
124124
code_lines = code.splitlines()

nbstata/magics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def _get_help_html(self, code):
428428
# %% ../nbs/09_magics.ipynb 56
429429
@patch_to(StataMagics)
430430
def magic_help(self, code, kernel, cell):
431-
"""Show help file from stata.com/help.cgi?\{\}"""
431+
r"""Show help file from stata.com/help.cgi?{}"""
432432
try:
433433
html_help = self._get_help_html(code)
434434
except Exception as e: # original: (urllib.error.HTTPError, urllib.error.URLError)

0 commit comments

Comments
 (0)