File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -400,9 +400,9 @@ class ParseContext(object):
400
400
def __init__ (self , filename , template = None ):
401
401
self .filename = os .path .abspath (filename )
402
402
if sys .platform == 'win32' :
403
- self .filename = self .filename .replace ( ' \\ ' , '/' )
403
+ self .filename = '/' . join ( self .filename .split ( os . sep ) )
404
404
if template is None :
405
- with io .open (filename , encoding = 'utf-8' ) as f :
405
+ with io .open (os . path . normpath ( filename ) , encoding = 'utf-8' ) as f :
406
406
self .template = f .read ()
407
407
else :
408
408
self .template = template
@@ -1251,7 +1251,7 @@ def succ(a):
1251
1251
if args .file == '-' :
1252
1252
ast = parse_template ('stdin' , sys .stdin .read ())
1253
1253
else :
1254
- with io .open (args .file , 'r' , encoding = 'utf-8' ) as f :
1254
+ with io .open (os . path . normpath ( args .file ) , 'r' , encoding = 'utf-8' ) as f :
1255
1255
ast = parse_template (args .file , f .read ())
1256
1256
if args .dump :
1257
1257
print (ast )
You can’t perform that action at this time.
0 commit comments