File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 2828from __future__ import print_function
2929
3030import os
31+ import os .path
3132import sys
3233
3334min_python3 = (3 , 5 )
@@ -70,6 +71,21 @@ if "ruamel.yaml" in sys.modules:
7071if "ruamel" in sys .modules :
7172 del sys .modules ["ruamel" ]
7273
74+ # The following code is here to avoid failures when updating
75+ # the develop version, due to spurious argparse.pyc files remaining
76+ # in the libs/spack/external directory, see:
77+ # https://github.com/spack/spack/pull/25376
78+ # TODO: Remove in v0.18.0 or later
79+ try :
80+ import argparse
81+ except ImportError :
82+ argparse_pyc = os .path .join (spack_external_libs , 'argparse.pyc' )
83+ if not os .path .exists (argparse_pyc ):
84+ raise
85+ os .remove (argparse_pyc )
86+ import argparse # noqa
87+
88+
7389import spack .main # noqa
7490
7591# Once we've set up the system path, run the spack main method
You can’t perform that action at this time.
0 commit comments