mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Minors in pull request #382 (https://github.com/JetBrains/intellij-community/pull/382)
This commit is contained in:
@@ -73,24 +73,26 @@ PATHS_FROM_ECLIPSE_TO_PYTHON = []
|
||||
|
||||
|
||||
normcase = os_normcase # May be rebound on set_ide_os
|
||||
import types
|
||||
str_to_unicode = types.UnicodeType
|
||||
|
||||
CTYPES_AVAILABLE = True
|
||||
try:
|
||||
import ctypes
|
||||
except ImportError:
|
||||
CTYPES_AVAILABLE = False
|
||||
|
||||
|
||||
def convert_to_long_pathname(filename):
|
||||
return filename
|
||||
if os.name == 'nt':
|
||||
try:
|
||||
import ctypes
|
||||
except ImportError:
|
||||
pass
|
||||
if sys.platform != "win32":
|
||||
return filename
|
||||
else:
|
||||
def convert_to_long_pathname(filename):
|
||||
if CTYPES_AVAILABLE:
|
||||
buf = ctypes.create_unicode_buffer(260)
|
||||
GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
|
||||
rv = GetLongPathName(str_to_unicode(filename), buf , 260)
|
||||
if rv == 0 or rv > 260:
|
||||
return filename
|
||||
else:
|
||||
rv = GetLongPathName(types.UnicodeType(filename), buf, 260)
|
||||
if rv != 0 and rv <= 260:
|
||||
return buf.value.encode(getfilesystemencoding())
|
||||
return filename
|
||||
|
||||
|
||||
def norm_case(filename):
|
||||
# `normcase` doesn't lower case on Python 2 for non-English locale, but Java side does it,
|
||||
|
||||
@@ -544,8 +544,7 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
|
||||
|
||||
public void testWinEggDebug() throws Exception {
|
||||
if (!SystemInfo.isWindows)
|
||||
{
|
||||
if (UsefulTestCase.IS_UNDER_TEAMCITY && !SystemInfo.isWindows) {
|
||||
return; // Only needs to run on windows
|
||||
}
|
||||
runPythonTest(new PyDebuggerTask("/debug", "test_winegg.py") {
|
||||
@@ -580,27 +579,21 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
public Set<String> getTags() {
|
||||
return ImmutableSet.of("-jython"); //TODO: fix that for Jython if anybody needs it
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public void testWinLongName() throws Exception {
|
||||
if (!SystemInfo.isWindows)
|
||||
{
|
||||
if (UsefulTestCase.IS_UNDER_TEAMCITY && !SystemInfo.isWindows) {
|
||||
return; // Only needs to run on windows
|
||||
}
|
||||
runPythonTest(new PyDebuggerTask("/debug", "long_n~1.py") {
|
||||
@Override
|
||||
public void before() throws Exception {
|
||||
|
||||
String scriptPath = getScriptPath();
|
||||
String longPath = FileUtil
|
||||
.toSystemDependentName((new File(scriptPath).getCanonicalPath()));
|
||||
LocalFileSystem.getInstance().refreshAndFindFileByPath(longPath);
|
||||
toggleBreakpoint(longPath, 2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -608,7 +601,6 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
waitForPause();
|
||||
eval("x").hasValue("10");
|
||||
resume();
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -616,8 +608,6 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
public Set<String> getTags() {
|
||||
return ImmutableSet.of("-jython"); //TODO: fix that for Jython if anybody needs it
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user