File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,25 @@ def gen_grpc():
183
183
# Needed to support absolute imports in files. See
184
184
# https://github.com/protocolbuffers/protobuf/issues/1491
185
185
make_absolute_imports (compiled_files )
186
+ copy_tree_merge (str (built_protos_dir ), str (proto_root_dir ))
187
+
188
+ def copy_tree_merge (src , dst ):
189
+ """
190
+ Recursively copy all files and subdirectories from src to dst,
191
+ overwriting files if they already exist. This emulates what
192
+ distutils.dir_util.copy_tree did without removing existing directories.
193
+ """
194
+ if not os .path .exists (dst ):
195
+ os .makedirs (dst )
196
+
197
+ for item in os .listdir (src ):
198
+ s = os .path .join (src , item )
199
+ d = os .path .join (dst , item )
200
+
201
+ if os .path .isdir (s ):
202
+ copy_tree_merge (s , d )
203
+ else :
204
+ shutil .copy2 (s , d )
186
205
187
206
def make_absolute_imports (compiled_files ):
188
207
for compiled in compiled_files :
You can’t perform that action at this time.
0 commit comments