From f0ac5f83722caa09d284e6268b302aca7075429a Mon Sep 17 00:00:00 2001 From: Andrew Brock Date: Wed, 29 Oct 2014 19:32:53 +1100 Subject: [PATCH 1/3] Fix crash when running a command while a command is running in python3 on windows --- dreampielib/subprocess/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dreampielib/subprocess/__init__.py b/dreampielib/subprocess/__init__.py index 0eaaf7d..46a42ea 100644 --- a/dreampielib/subprocess/__init__.py +++ b/dreampielib/subprocess/__init__.py @@ -480,7 +480,7 @@ def execute(self, source): PeekNamedPipe(handle, None, 0, None, byref(avail), None) nAvail = avail.value if nAvail > 0: - rem_stdin.append(os.read(fd, nAvail)) + rem_stdin.append(unicodify(os.read(fd, nAvail))) else: # I don't know how to do this in Jython. pass From b56f1860a4b0d14bdcf7279d49f3bac6dc1ad95c Mon Sep 17 00:00:00 2001 From: Andrew Brock Date: Wed, 29 Oct 2014 19:40:33 +1100 Subject: [PATCH 2/3] Make popup documentation consistent between python 2 & 3 (CPython only) when __doc__ is added/modified after the function definition --- dreampielib/subprocess/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dreampielib/subprocess/__init__.py b/dreampielib/subprocess/__init__.py index 46a42ea..5c77704 100644 --- a/dreampielib/subprocess/__init__.py +++ b/dreampielib/subprocess/__init__.py @@ -828,7 +828,8 @@ def get_func_doc(self, expr): # If so, return pydoc's documentation. # This test is CPython-specific. Another approach would be to look for # the string in the source code. - co_consts = getattr(getattr(obj, 'func_code', None), 'co_consts', None) + func_code = getattr(obj, '__code__', getattr(obj, 'func_code', None)) + co_consts = getattr(func_code, 'co_consts', None) __doc__ = getattr(obj, '__doc__', None) if co_consts is not None and __doc__ is not None: if __doc__ not in co_consts: From 1fc4fbbd519f8e8f6398e0df585480effbff6454 Mon Sep 17 00:00:00 2001 From: Andrew Brock Date: Wed, 29 Oct 2014 19:45:38 +1100 Subject: [PATCH 3/3] include keyword-only arguments in autocomplete suggestions for python3 functions --- dreampielib/subprocess/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dreampielib/subprocess/__init__.py b/dreampielib/subprocess/__init__.py index 5c77704..4e141e1 100644 --- a/dreampielib/subprocess/__init__.py +++ b/dreampielib/subprocess/__init__.py @@ -628,7 +628,8 @@ def get_func_args(self, expr): if not py3k: args = inspect.getargspec(obj)[0] else: - args = inspect.getfullargspec(obj).args #@UndefinedVariable + argspec = inspect.getfullargspec(obj) + args = argspec.args + argspec.kwonlyargs #@UndefinedVariable except TypeError: return None # There may be nested args, so we filter them