@@ -155,7 +155,7 @@ def parse_version(v):
155
155
help = "don't warn if typeshed is out of sync" )
156
156
parser .add_argument ('--pdb' , action = 'store_true' , help = "invoke pdb on fatal error" )
157
157
parser .add_argument ('--use-python-path' , action = 'store_true' ,
158
- help = "search for modules in sys.path of running Python " )
158
+ help = "an anti-pattern " )
159
159
parser .add_argument ('--stats' , action = 'store_true' , help = "dump stats" )
160
160
parser .add_argument ('--inferstats' , action = 'store_true' , help = "dump type inference stats" )
161
161
parser .add_argument ('--custom-typing' , metavar = 'MODULE' , help = "use a custom typing module" )
@@ -180,6 +180,14 @@ def parse_version(v):
180
180
181
181
args = parser .parse_args ()
182
182
183
+ # --use-python-path is no longer supported; explain why.
184
+ if args .use_python_path :
185
+ parser .error ("Sorry, --use-python-path is no longer supported.\n "
186
+ "If you are trying this because your code depends on a library module,\n "
187
+ "you should really investigate how to obtain stubs for that module.\n "
188
+ "See https://github.com/python/mypy/issues/1411 for more discussion."
189
+ )
190
+
183
191
# Check for invalid argument combinations.
184
192
code_methods = sum (bool (c ) for c in [args .modules , args .command , args .package , args .files ])
185
193
if code_methods == 0 :
0 commit comments