Skip to content

Commit 4d62b09

Browse files
committed
Make quote stripping a single call to .strip
1 parent 1163c25 commit 4d62b09

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

nbs/01_config.ipynb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,7 @@
426426
"source": [
427427
"#| export\n",
428428
"def set_pystata_path(stata_dir=None):\n",
429-
" stata_dir = stata_dir.strip('\"')\n",
430-
" stata_dir = stata_dir.replace(\"'\", \"\")\n",
429+
" stata_dir = stata_dir.strip('\"\\'')\n",
431430
" if stata_dir is None:\n",
432431
" stata_dir, _ = find_dir_edition()\n",
433432
" if not os.path.isdir(stata_dir):\n",

nbstata/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ def find_edition(stata_dir):
114114

115115
# %% ../nbs/01_config.ipynb 25
116116
def set_pystata_path(stata_dir=None):
117-
stata_dir = stata_dir.strip('"')
118-
stata_dir = stata_dir.replace("'", "")
117+
stata_dir = stata_dir.strip('"\'')
119118
if stata_dir is None:
120119
stata_dir, _ = find_dir_edition()
121120
if not os.path.isdir(stata_dir):

0 commit comments

Comments
 (0)