Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: third_party/cython/cp_python_binary_modules.py

Issue 565673004: cython: Fix creation error when directory is created by a parallel process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import argparse 5 import argparse
6 import os 6 import os
7 import shutil 7 import shutil
8 import sys 8 import sys
9 9
10 def touch(fname): 10 def touch(fname):
(...skipping 11 matching lines...) Expand all
22 'hierarchy.') 22 'hierarchy.')
23 parser.add_argument('timestamp', help='The timetsamp file.') 23 parser.add_argument('timestamp', help='The timetsamp file.')
24 parser.add_argument('lib_dir', help='The directory containing the modules') 24 parser.add_argument('lib_dir', help='The directory containing the modules')
25 parser.add_argument('destination_dir', 25 parser.add_argument('destination_dir',
26 help='The destination directory of the module') 26 help='The destination directory of the module')
27 parser.add_argument('mappings', nargs='+', 27 parser.add_argument('mappings', nargs='+',
28 help='The mapping from module to library.') 28 help='The mapping from module to library.')
29 opts = parser.parse_args() 29 opts = parser.parse_args()
30 30
31 if not os.path.exists(opts.destination_dir): 31 if not os.path.exists(opts.destination_dir):
32 os.makedirs(opts.destination_dir) 32 try:
33 os.makedirs(opts.destination_dir)
34 except:
35 # Ignore errors on directory creation.
36 pass
33 37
34 for mapping in opts.mappings: 38 for mapping in opts.mappings:
35 [module, library] = mapping.split('=') 39 [module, library] = mapping.split('=')
36 shutil.copy(os.path.join(opts.lib_dir, library), 40 shutil.copy(os.path.join(opts.lib_dir, library),
37 os.path.join(opts.destination_dir, module)) 41 os.path.join(opts.destination_dir, module))
38 42
39 touch(opts.timestamp) 43 touch(opts.timestamp)
40 44
41 if __name__ == '__main__': 45 if __name__ == '__main__':
42 main() 46 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698