From 3a0fd0f3ab6b191143dd13386e402e83a33bcb6c Mon Sep 17 00:00:00 2001 From: Alexander Koshevoy Date: Sun, 6 Nov 2016 18:01:22 +0300 Subject: [PATCH] PY-21352 Bug that None as the host argument value of pydevd.settrace() method has been passed as "None" string literal --- python/helpers/pydev/_pydev_bundle/pydev_monkey.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/helpers/pydev/_pydev_bundle/pydev_monkey.py b/python/helpers/pydev/_pydev_bundle/pydev_monkey.py index 67a6606c4267..228254d686ce 100644 --- a/python/helpers/pydev/_pydev_bundle/pydev_monkey.py +++ b/python/helpers/pydev/_pydev_bundle/pydev_monkey.py @@ -30,12 +30,13 @@ def _get_pydevd_args(): return new_args def _get_python_c_args(host, port, indC, args): + host_literal = "'" + host + "'" if host is not None else 'None' return ("import sys; sys.path.append(r'%s'); import pydevd; " - "pydevd.settrace(host='%s', port=%s, suspend=False, trace_only_current_thread=False, patch_multiprocessing=True); " + "pydevd.settrace(host=%s, port=%s, suspend=False, trace_only_current_thread=False, patch_multiprocessing=True); " "sys.original_argv = %s; %s" ) % ( pydev_src_dir, - host, + host_literal, port, _get_pydevd_args(), args[indC + 1])