Skip to content

Commit

Permalink
Fixes for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Oct 9, 2023
1 parent c425d3e commit 3dc875b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static class Versions {
public static final List<String> VERSION_NUMBERS = new ArrayList<String>();

public static final String JYTHON_VERSION_LATEST = JYTHON_VERSION_3_0;
public static final String PYTHON_VERSION_LATEST = PYTHON_VERSION_3_11;
public static final String PYTHON_VERSION_LATEST = PYTHON_VERSION_3_12;
public static final String IRONPYTHON_VERSION_LATEST = IRONPYTHON_VERSION_3_0;

public static final String INTERPRETER_VERSION = "interpreter";
Expand All @@ -59,6 +59,7 @@ public static class Versions {
ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_9);
ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_10);
ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_11);
ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_3_12);
ALL_PYTHON_VERSIONS.add(PYTHON_VERSION_INTERPRETER);

ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_0);
Expand All @@ -68,6 +69,7 @@ public static class Versions {
ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_9);
ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_10);
ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_11);
ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_3_12);
ALL_JYTHON_VERSIONS.add(JYTHON_VERSION_INTERPRETER);

ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_0);
Expand All @@ -77,6 +79,7 @@ public static class Versions {
ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_9);
ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_10);
ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_11);
ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_3_12);
ALL_IRONPYTHON_VERSIONS.add(IRONPYTHON_VERSION_INTERPRETER);

ALL_VERSIONS_ANY_FLAVOR.addAll(ALL_JYTHON_VERSIONS);
Expand All @@ -90,6 +93,7 @@ public static class Versions {
VERSION_NUMBERS.add("3.9"); // actually the same as 3.8
VERSION_NUMBERS.add("3.10");
VERSION_NUMBERS.add("3.11");
VERSION_NUMBERS.add("3.12");
VERSION_NUMBERS.add(INTERPRETER_VERSION);

// Anything below 3.5 is marked as 3.5
Expand All @@ -111,6 +115,8 @@ public static class Versions {
mappedVersions.put("3.10", "3.10");

mappedVersions.put("3.11", "3.11");

mappedVersions.put("3.12", "3.12");
}

/**
Expand Down Expand Up @@ -206,6 +212,7 @@ public static int getInternalVersion(String version) {
public static final String PYTHON_VERSION_3_9 = "python 3.9";
public static final String PYTHON_VERSION_3_10 = "python 3.10";
public static final String PYTHON_VERSION_3_11 = "python 3.11";
public static final String PYTHON_VERSION_3_12 = "python 3.12";
public static final String PYTHON_VERSION_INTERPRETER = "python interpreter";

public static final String JYTHON_VERSION_3_0 = "jython 3.5";
Expand All @@ -215,6 +222,7 @@ public static int getInternalVersion(String version) {
public static final String JYTHON_VERSION_3_9 = "jython 3.9";
public static final String JYTHON_VERSION_3_10 = "jython 3.10";
public static final String JYTHON_VERSION_3_11 = "jython 3.11";
public static final String JYTHON_VERSION_3_12 = "jython 3.12";
public static final String JYTHON_VERSION_INTERPRETER = "jython interpreter";

public static final String IRONPYTHON_VERSION_3_0 = "ironpython 3.5";
Expand All @@ -224,6 +232,7 @@ public static int getInternalVersion(String version) {
public static final String IRONPYTHON_VERSION_3_9 = "ironpython 3.9";
public static final String IRONPYTHON_VERSION_3_10 = "ironpython 3.10";
public static final String IRONPYTHON_VERSION_3_11 = "ironpython 3.11";
public static final String IRONPYTHON_VERSION_3_12 = "ironpython 3.12";
public static final String IRONPYTHON_VERSION_INTERPRETER = "ironpython interpreter";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public void setElementLimit(Integer elementLimit) {
private void addDragAdapters(StructuredViewer viewer) {
Transfer[] transfers = new Transfer[] { ResourceTransfer.getInstance() };
int ops = DND.DROP_COPY | DND.DROP_LINK;
viewer.addDragSupport(ops, transfers, new NavigatorDragAdapter(viewer));
viewer.addDragSupport(ops, transfers, new PyNavigatorDragAdapter(viewer));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Implements drag behaviour when items are dragged out of the resource
* navigator. Copied from deprecated org.eclipse.ui.views.navigator.NavigatorDragAdapter
*/
public class NavigatorDragAdapter extends DragSourceAdapter {
public class PyNavigatorDragAdapter extends DragSourceAdapter {
private static final String CHECK_MOVE_TITLE = "Check Move";

private static final String CHECK_DELETE_MESSAGE = "{0} is read-only. Do you still wish to delete it?";
Expand All @@ -43,7 +43,7 @@ public class NavigatorDragAdapter extends DragSourceAdapter {
*
* @param provider The selection provider
*/
public NavigatorDragAdapter(ISelectionProvider provider) {
public PyNavigatorDragAdapter(ISelectionProvider provider) {
selectionProvider = provider;
}

Expand Down

0 comments on commit 3dc875b

Please sign in to comment.