Properly consider that argv[0] may be None. debugpy:987
@@ -440,8 +440,9 @@ class PyDevJsonCommandProcessor(object):
argv = getattr(sys, 'argv', [])
if argv:
f = argv[0]
+ if f: # argv[0] could be None (https://github.com/microsoft/debugpy/issues/987)
if os.path.isdir(f):
- watch_dirs.append(program)
+ watch_dirs.append(f)
else:
watch_dirs.append(os.path.dirname(f))
