$OpenBSD: patch-jupyter_core_command_py,v 1.2 2020/02/16 05:20:29 bket Exp $
Index: jupyter_core/command.py
--- jupyter_core/command.py.orig
+++ jupyter_core/command.py
@@ -84,7 +84,13 @@ def list_subcommands():
                 if sys.platform.startswith('win'):
                     # remove file-extension on Windows
                     name = os.path.splitext(name)[0]
-                subcommand_tuples.add(tuple(name.split('-')[1:]))
+                if name == 'jupyter-3':
+                    continue
+                if sys.version_info.major == 3 and name.endswith('-3'):
+                    name = name.replace('-3', '')
+                    subcommand_tuples.add(tuple(name.split('-')[1:]))
+                elif sys.version_info.major == 2 and not name.endswith('-3'):
+                    subcommand_tuples.add(tuple(name.split('-')[1:]))
     # build a set of subcommand strings, excluding subcommands whose parents are defined
     subcommands = set()
     # Only include `jupyter-foo-bar` if `jupyter-foo` is not already present
@@ -245,7 +251,8 @@ def main():
         sys.exit("subcommand is required")
 
     command = _jupyter_abspath(subcommand)
-
+    if sys.version_info.major == 3 and not command.endswith('-3'):
+        command += '-3'
     try:
         _execvp(command, sys.argv[1:])
     except OSError as e:
