mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git.labs.intellij.net:idea/ultimate
This commit is contained in:
@@ -51,7 +51,7 @@ class TeamcityTestResult(TestResult):
|
||||
start = getattr(test, "startTime", datetime.datetime.now())
|
||||
d = datetime.datetime.now() - start
|
||||
duration=d.microseconds / 1000 + d.seconds * 1000 + d.days * 86400000
|
||||
self.messages.testFinished(self.getTestName(test), duration=duration)
|
||||
self.messages.testFinished(self.getTestName(test), duration=int(duration))
|
||||
|
||||
class TeamcityTestRunner:
|
||||
def __init__(self, stream=sys.stdout):
|
||||
|
||||
@@ -50,13 +50,15 @@ public class PythonRegexpInjector implements LanguageInjector {
|
||||
final PyExpression[] args = ((PyArgumentList)host.getParent()).getArguments();
|
||||
int index = ArrayUtil.indexOf(args, host);
|
||||
PyCallExpression call = PsiTreeUtil.getParentOfType(host, PyCallExpression.class);
|
||||
final PyExpression callee = call.getCallee();
|
||||
if (callee instanceof PyReferenceExpression && canBeRegexpCall(callee)) {
|
||||
final PsiElement element = ((PyReferenceExpression)callee).getReference().resolve();
|
||||
if (element != null && element.getContainingFile().getName().equals("re.py") && isRegexpMethod(element, index)) {
|
||||
List<TextRange> ranges = ((PyStringLiteralExpression)host).getStringValueTextRanges();
|
||||
if (ranges.size() == 1) {
|
||||
injectionPlacesRegistrar.addPlace(RegExpLanguage.INSTANCE, ranges.get(0), null, null);
|
||||
if (call != null) {
|
||||
final PyExpression callee = call.getCallee();
|
||||
if (callee instanceof PyReferenceExpression && canBeRegexpCall(callee)) {
|
||||
final PsiElement element = ((PyReferenceExpression)callee).getReference().resolve();
|
||||
if (element != null && element.getContainingFile().getName().equals("re.py") && isRegexpMethod(element, index)) {
|
||||
List<TextRange> ranges = ((PyStringLiteralExpression)host).getStringValueTextRanges();
|
||||
if (ranges.size() == 1) {
|
||||
injectionPlacesRegistrar.addPlace(RegExpLanguage.INSTANCE, ranges.get(0), null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ public class PyCallExpressionImpl extends PyElementImpl implements PyCallExpress
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (((PyFile)getContainingFile()).getLanguageLevel().isPy3K()) {
|
||||
else if (((PyFile)getContainingFile()).getLanguageLevel().isPy3K() && containingClass != null) {
|
||||
return getFirstSuperClassType(containingClass);
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,8 @@ public class PyCallExpressionImpl extends PyElementImpl implements PyCallExpress
|
||||
return null;
|
||||
}
|
||||
|
||||
private static PyType getFirstSuperClassType(PyClass first_class) {
|
||||
@Nullable
|
||||
private static PyType getFirstSuperClassType(@NotNull PyClass first_class) {
|
||||
// TODO handle __mro__ here
|
||||
final PyClass[] supers = first_class.getSuperClasses();
|
||||
if (supers.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user