mercurial/templater.py
branchstable
changeset 47836 f3b1df44b716
parent 47830 981cef5188c3
child 47857 2b76255a4f74
equal deleted inserted replaced
47835:da39b9c1c486 47836:f3b1df44b716
   850             if os.path.isfile(abs):
   850             if os.path.isfile(abs):
   851                 subresource = util.posixfile(abs, b'rb')
   851                 subresource = util.posixfile(abs, b'rb')
   852         if not subresource:
   852         if not subresource:
   853             if pycompat.ossep not in rel:
   853             if pycompat.ossep not in rel:
   854                 abs = rel
   854                 abs = rel
   855                 subresource = resourceutil.open_resource(
   855                 try:
   856                     b'mercurial.templates', rel
   856                     subresource = resourceutil.open_resource(
   857                 )
   857                         b'mercurial.templates', rel
       
   858                     )
       
   859                 except resourceutil.FileNotFoundError:
       
   860                     subresource = None
   858             else:
   861             else:
   859                 dir = templatedir()
   862                 dir = templatedir()
   860                 if dir:
   863                 if dir:
   861                     abs = os.path.normpath(os.path.join(dir, rel))
   864                     abs = os.path.normpath(os.path.join(dir, rel))
   862                     if os.path.isfile(abs):
   865                     if os.path.isfile(abs):