@@ -54,7 +54,7 @@ def on_modified(self, event: FileSystemEvent):
5454 if event .is_directory :
5555 return
5656
57- file_type = Path (event .src_path ).suffix
57+ file_type = Path (str ( event .src_path ) ).suffix
5858
5959 # Ignore files that don't match the file types
6060 if file_type not in self .file_types :
@@ -93,17 +93,17 @@ def check_directory_ownership(path: Path) -> bool:
9393 return stat .st_uid == os .getuid () and stat .st_gid == os .getgid ()
9494
9595
96- def get_env (env_type : Union [ Type [ TypedDict ], Type [ TypedDict ]], abort : bool = True ) -> TypedDict :
96+ def get_env (env_type : RosEnv , abort : bool = True ) -> RosEnv :
9797 if abort :
9898 for env in env_type .__required_keys__ : # type: ignore
9999 if env not in os .environ :
100100 raise click .ClickException (f"{ env } environment variable must be set." )
101101
102- return cast (env_type , {k : os .environ [k ] for k in env_type .__required_keys__ })
102+ return cast (env_type , {k : os .environ [k ] for k in env_type .__required_keys__ }) # type: ignore
103103
104104
105105def get_ros_env (abort : bool = True ) -> RosEnv :
106- return get_env (RosEnv , abort )
106+ return get_env (RosEnv , abort ) # type: ignore
107107
108108
109109def is_ci_environment () -> bool :
@@ -205,7 +205,7 @@ def start_watcher(
205205
206206 for folder in folders :
207207 # Watch all folders in the current directory
208- observer .schedule (handler , cwd / folder , recursive = True )
208+ observer .schedule (handler , str ( cwd / folder ) , recursive = True )
209209
210210 observer .start ()
211211
@@ -262,24 +262,24 @@ def call(
262262 try :
263263 with subprocess .Popen (
264264 command , shell = True , executable = "/bin/bash" , cwd = cwd , env = env_extended
265- ) as process :
265+ ) as proc :
266266 # this is the internal time to wait for the process to exit after SIGINT, and then SIGTERM is sent
267- process ._sigint_wait_secs = 10.0
267+ proc ._sigint_wait_secs = 10.0 # type: ignore
268268 try :
269- stdout , stderr = process .communicate (input , timeout = None )
269+ stdout , stderr = proc .communicate ()
270270 except Exception as e : # Including KeyboardInterrupt, communicate handled that.
271271 # looking at the python stdlib code, the SIGINT is already sent in the communicate/wait method
272272 # so if we reach this point the process hasn't exited yet, so we need to send SIGTERM
273273 print ("Sending SIGTERM to process" )
274- process .send_signal (signal .SIGTERM )
275- process .wait ()
274+ proc .send_signal (signal .SIGTERM )
275+ proc .wait ()
276276 raise e
277- retcode = process .poll ()
277+ retcode = proc .poll () or 0
278278 if abort and retcode :
279279 raise subprocess .CalledProcessError (
280- retcode , process .args , output = stdout , stderr = stderr
280+ retcode , proc .args , output = stdout , stderr = stderr
281281 )
282- return subprocess .CompletedProcess (process .args , retcode , stdout , stderr )
282+ return subprocess .CompletedProcess (proc .args , retcode , stdout , stderr )
283283
284284 except subprocess .CalledProcessError as e :
285285 if retry > 0 :
0 commit comments