mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote branch 'origin/master'
This commit is contained in:
@@ -24,7 +24,7 @@ but seemingly no one uses them in C extensions yet anyway.
|
||||
# * re.search-bound, ~30% time, in likes of builtins and _gtk with complex docstrings.
|
||||
# None of this can seemingly be easily helped. Maybe there's a simpler and faster parser library?
|
||||
|
||||
VERSION = "1.104" # Must be a number-dot-number string, updated with each change that affects generated skeletons
|
||||
VERSION = "1.105" # Must be a number-dot-number string, updated with each change that affects generated skeletons
|
||||
# Note: DON'T FORGET TO UPDATE!
|
||||
|
||||
VERSION_CONTROL_HEADER_FORMAT = '# from %s by generator %s'
|
||||
@@ -911,6 +911,7 @@ class ModuleRedeclarator(object):
|
||||
}
|
||||
|
||||
if version[0] < 3:
|
||||
PREDEFINED_MOD_CLASS_SIGS[("exceptions", "BaseException", "__unicode__")] = ("(self)", UNICODE_LIT)
|
||||
PREDEFINED_MOD_CLASS_SIGS[("itertools", "product", "__init__")] = ("(self, *iterables, **kwargs)", LIST_LIT)
|
||||
else:
|
||||
PREDEFINED_MOD_CLASS_SIGS[("itertools", "product", "__init__")] = ("(self, *iterables, repeat=1)", LIST_LIT)
|
||||
@@ -936,36 +937,20 @@ class ModuleRedeclarator(object):
|
||||
KNOWN_PROPS = {
|
||||
BUILTIN_MOD_NAME: {
|
||||
("object", '__class__'): ('r', G_TYPE),
|
||||
("BaseException", '__dict__'): ('r', G_DICT),
|
||||
("BaseException", 'message'): ('rwd', G_STR),
|
||||
("BaseException", 'args'): ('r', G_TUPLE),
|
||||
('complex', 'real'): ('r', G_FLOAT),
|
||||
('complex', 'imag'): ('r', G_FLOAT),
|
||||
("EnvironmentError", 'errno'): ('rwd', G_INT),
|
||||
("EnvironmentError", 'message'): ('rwd', G_STR),
|
||||
("EnvironmentError", 'strerror'): ('rwd', G_INT),
|
||||
("EnvironmentError", 'filename'): ('rwd', G_STR),
|
||||
("file", 'softspace'): ('r', G_BOOL),
|
||||
("file", 'name'): ('r', G_STR),
|
||||
("file", 'encoding'): ('r', G_STR),
|
||||
("file", 'mode'): ('r', G_STR),
|
||||
("file", 'closed'): ('r', G_BOOL),
|
||||
("file", 'newlines'): ('r', G_STR),
|
||||
("SyntaxError", 'text'): ('rwd', G_STR),
|
||||
("SyntaxError", 'print_file_and_line'): ('rwd', G_BOOL),
|
||||
("SyntaxError", 'filename'): ('rwd', G_STR),
|
||||
("SyntaxError", 'lineno'): ('rwd', G_INT),
|
||||
("SyntaxError", 'offset'): ('rwd', G_INT),
|
||||
("SyntaxError", 'msg'): ('rwd', G_STR),
|
||||
("SyntaxError", 'message'): ('rwd', G_STR),
|
||||
("slice", 'start'): ('r', G_INT),
|
||||
("slice", 'step'): ('r', G_INT),
|
||||
("slice", 'stop'): ('r', G_INT),
|
||||
("super", '__thisclass__'): ('r', G_TYPE),
|
||||
("super", '__self__'): ('r', G_TYPE),
|
||||
("super", '__self_class__'): ('r', G_TYPE),
|
||||
("SystemExit", 'message'): ('rwd', G_STR),
|
||||
("SystemExit", 'code'): ('rwd', G_OBJECT),
|
||||
("type", '__basicsize__'): ('r', G_INT),
|
||||
("type", '__itemsize__'): ('r', G_INT),
|
||||
("type", '__base__'): ('r', G_TYPE),
|
||||
@@ -976,6 +961,24 @@ class ModuleRedeclarator(object):
|
||||
("type", '__dict__'): ('r', G_DICT),
|
||||
("type", '__name__'): ('r', G_STR),
|
||||
("type", '__weakrefoffset__'): ('r', G_INT),
|
||||
},
|
||||
"exceptions": {
|
||||
("BaseException", '__dict__'): ('r', G_DICT),
|
||||
("BaseException", 'message'): ('rwd', G_STR),
|
||||
("BaseException", 'args'): ('r', G_TUPLE),
|
||||
("EnvironmentError", 'errno'): ('rwd', G_INT),
|
||||
("EnvironmentError", 'message'): ('rwd', G_STR),
|
||||
("EnvironmentError", 'strerror'): ('rwd', G_INT),
|
||||
("EnvironmentError", 'filename'): ('rwd', G_STR),
|
||||
("SyntaxError", 'text'): ('rwd', G_STR),
|
||||
("SyntaxError", 'print_file_and_line'): ('rwd', G_BOOL),
|
||||
("SyntaxError", 'filename'): ('rwd', G_STR),
|
||||
("SyntaxError", 'lineno'): ('rwd', G_INT),
|
||||
("SyntaxError", 'offset'): ('rwd', G_INT),
|
||||
("SyntaxError", 'msg'): ('rwd', G_STR),
|
||||
("SyntaxError", 'message'): ('rwd', G_STR),
|
||||
("SystemExit", 'message'): ('rwd', G_STR),
|
||||
("SystemExit", 'code'): ('rwd', G_OBJECT),
|
||||
("UnicodeDecodeError", '__basicsize__'): None,
|
||||
("UnicodeDecodeError", '__itemsize__'): None,
|
||||
("UnicodeDecodeError", '__base__'): None,
|
||||
@@ -2420,14 +2423,15 @@ def processOne(name, mod_file_name, doing_builtins):
|
||||
subfile.close()
|
||||
except:
|
||||
exctype, value = sys.exc_info()[:2]
|
||||
msg = "Failed to process %r while %s: %s" % (name, _current_action, str(value))
|
||||
report(msg)
|
||||
msg = "Failed to process %r while %s: %s"
|
||||
args = name, _current_action, str(value)
|
||||
report(msg, *args)
|
||||
if outfile is not None and not outfile.closed:
|
||||
outfile.write("# encoding: %s\n" % OUT_ENCODING)
|
||||
outfile.write("# module %s\n" % name)
|
||||
outfile.write(VERSION_CONTROL_HEADER_FORMAT % (mod_file_name, VERSION))
|
||||
outfile.write("\n\n")
|
||||
outfile.write("# Skeleton generation error:\n#\n# " + msg + "\n")
|
||||
outfile.write("# Skeleton generation error:\n#\n# " + (msg % args) + "\n")
|
||||
if debug_mode:
|
||||
if sys.platform == 'cli':
|
||||
traceback.print_exc(file=sys.stderr)
|
||||
|
||||
@@ -1226,9 +1226,7 @@ def _locked_settrace(host, stdoutToServer, stderrToServer, port, suspend, trace_
|
||||
except:
|
||||
pass
|
||||
|
||||
#sys.exitfunc = exit_hook
|
||||
import atexit
|
||||
atexit.register(exit_hook)
|
||||
sys.exitfunc = exit_hook
|
||||
|
||||
PyDBCommandThread(debugger).start()
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ import sys
|
||||
import traceback
|
||||
|
||||
|
||||
normcase = os.path.normcase
|
||||
|
||||
basename = os.path.basename
|
||||
exists = os.path.exists
|
||||
join = os.path.join
|
||||
@@ -78,6 +78,17 @@ NORM_FILENAME_AND_BASE_CONTAINER = {}
|
||||
NORM_FILENAME_TO_SERVER_CONTAINER = {}
|
||||
NORM_FILENAME_TO_CLIENT_CONTAINER = {}
|
||||
|
||||
|
||||
pycharm_os = None
|
||||
|
||||
def normcase(file):
|
||||
global pycharm_os
|
||||
if pycharm_os == 'UNIX':
|
||||
return file
|
||||
else:
|
||||
return os.path.normcase(file)
|
||||
|
||||
|
||||
def _NormFile(filename):
|
||||
try:
|
||||
return NORM_FILENAME_CONTAINER[filename]
|
||||
@@ -264,6 +275,6 @@ def GetFilenameAndBase(frame):
|
||||
f = frame.f_code.co_filename
|
||||
return GetFileNameAndBaseFromFile(f)
|
||||
|
||||
def set_pycharm_os(pycharm_os):
|
||||
if pycharm_os == 'UNIX':
|
||||
normcase = lambda x: x
|
||||
def set_pycharm_os(os):
|
||||
global pycharm_os
|
||||
pycharm_os = os
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
(default) 1.92 # anything not explicitly marked
|
||||
|
||||
(built-in) 1.104 # skeletons of all built-in modules are built together
|
||||
(built-in) 1.105 # skeletons of all built-in modules are built together
|
||||
# Note: modules like itertools, etc are "(built-in)" and are ignored if given separately
|
||||
|
||||
_fileio 1.101
|
||||
|
||||
@@ -77,15 +77,17 @@ public class RemoteDebugger implements ProcessDebugger {
|
||||
//it is closed in close() method on process termination
|
||||
}
|
||||
|
||||
try {
|
||||
final DebuggerReader reader = new DebuggerReader();
|
||||
ApplicationManager.getApplication().executeOnPooledThread(reader);
|
||||
}
|
||||
catch (Exception e) {
|
||||
synchronized (mySocketObject) {
|
||||
mySocket.close();
|
||||
if (myConnected) {
|
||||
try {
|
||||
final DebuggerReader reader = new DebuggerReader();
|
||||
ApplicationManager.getApplication().executeOnPooledThread(reader);
|
||||
}
|
||||
catch (Exception e) {
|
||||
synchronized (mySocketObject) {
|
||||
mySocket.close();
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +352,7 @@ public class RemoteDebugger implements ProcessDebugger {
|
||||
myServerSocket.close();
|
||||
}
|
||||
catch (IOException e) {
|
||||
//skip
|
||||
LOG.warn("Error closing socket", e);
|
||||
}
|
||||
}
|
||||
disconnect();
|
||||
|
||||
@@ -205,6 +205,7 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr
|
||||
myDebugger.run();
|
||||
}
|
||||
catch (final Exception e) {
|
||||
myWaitingForConnection = false;
|
||||
myProcessHandler.destroyProcess();
|
||||
if (!myClosing) {
|
||||
invokeLater(new Runnable() {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class PyFileElementType extends IStubFileElementType<PyFileStub> {
|
||||
|
||||
@Override
|
||||
public int getStubVersion() {
|
||||
return 42;
|
||||
return 43;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -67,6 +67,18 @@ public class PyNamedParameterElementType extends PyStubElementType<PyNamedParame
|
||||
getStubElementType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCreateStub(ASTNode node) {
|
||||
final ASTNode paramList = node.getTreeParent();
|
||||
if (paramList != null) {
|
||||
final ASTNode container = paramList.getTreeParent();
|
||||
if (container != null && container.getElementType() == PyElementTypes.LAMBDA_EXPRESSION) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return super.shouldCreateStub(node);
|
||||
}
|
||||
|
||||
protected IStubElementType getStubElementType() {
|
||||
return PyElementTypes.NAMED_PARAMETER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user