File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 44import sys
55import argparse
66from logging import Logger , basicConfig , getLogger
7- from os import getenv , environ
7+ from os import getenv , environ , pathsep
88from pathlib import Path
99from typing import List , Set , Optional
1010
@@ -84,13 +84,14 @@ def expand(self, source: str) -> str:
8484 parser .add_argument ('--lib' , help = 'Path to Atcoder Library' )
8585 opts = parser .parse_args ()
8686
87- lib_path = Path . cwd ()
87+ lib_paths = []
8888 if opts .lib :
89- lib_path = Path (opts .lib )
90- elif 'CPLUS_INCLUDE_PATH' in environ :
91- lib_path = Path (environ ['CPLUS_INCLUDE_PATH' ])
92-
93- expander = Expander ([lib_path ])
89+ lib_paths .append (Path (opts .lib ))
90+ if 'CPLUS_INCLUDE_PATH' in environ :
91+ lib_paths .extend (
92+ map (Path , filter (None , environ ['CPLUS_INCLUDE_PATH' ].split (pathsep ))))
93+ lib_paths .append (Path .cwd ())
94+ expander = Expander (lib_paths )
9495 source = open (opts .source ).read ()
9596 output = expander .expand (source )
9697
You can’t perform that action at this time.
0 commit comments