Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e54062

Browse files
committed
Fix# 11559 weird regexp in magic writefile
1 parent 512d473 commit 7e54062

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

IPython/core/magics/osm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ def writefile(self, line, cell):
825825
The file will be overwritten unless the -a (--append) flag is specified.
826826
"""
827827
args = magic_arguments.parse_argstring(self.writefile, line)
828-
if re.match(r'[\'*\']|["*"]', args.filename):
828+
if re.match(r'^(\'.*\')|(".*")$', args.filename):
829829
filename = os.path.expanduser(args.filename[1:-1])
830830
else:
831831
filename = os.path.expanduser(args.filename)

0 commit comments

Comments
 (0)