File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -61,14 +61,20 @@ def include(manifest, **kwargs):
61
61
for m in manifest :
62
62
include (m )
63
63
else :
64
+ options = IncludeOptions (** kwargs )
64
65
manifest = convert_path (manifest )
65
- with open (manifest ) as f :
66
- # Make paths relative to this manifest file while processing it.
67
- # Applies to includes and input files.
68
- prev_cwd = os .getcwd ()
69
- os .chdir (os .path .dirname (manifest ))
70
- exec (f .read (), globals (), {"options" : IncludeOptions (** kwargs )})
71
- os .chdir (prev_cwd )
66
+ try :
67
+ with open (manifest ) as f :
68
+ # Make paths relative to this manifest file while processing it.
69
+ # Applies to includes and input files.
70
+ prev_cwd = os .getcwd ()
71
+ os .chdir (os .path .dirname (manifest ))
72
+ exec (f .read (), globals (), {"options" : options })
73
+ os .chdir (prev_cwd )
74
+ except FileNotFoundError as er :
75
+ # If manifest doesn't exist and is Not optional, raise error.
76
+ if not options .optional :
77
+ raise (er )
72
78
73
79
74
80
def freeze (path , script = None , opt = 0 ):
You can’t perform that action at this time.
0 commit comments