class_docstr: Abstract base class defining methods for KernelProvisioner classes.
  
  A majority of methods are abstract (requiring implementations via a subclass) while
  some are optional and others provide implementations common to all instances.
  Subclasses should be aware of which methods require a call to the superclass.
  
  Many of these methods model those of :class:`subprocess.Popen` for parity with
  previous versions where the kernel process was managed directly.
class_docstr_tok: ["Abstract","base","class","defining","methods","for","KernelProvisioner","classes",".","A","majority","of","methods","are","abstract","(","requiring","implementations","via","a","subclass",")","while","some","are","optional","and","others","provide","implementations","common","to","all","instances",".","Subclasses","should","be","aware","of","which","methods","require","a","call","to","the","superclass",".","Many","of","these","methods","model","those","of",":","class",":","`","subprocess.Popen","`","for","parity","with","previous","versions","where","the","kernel","process","was","managed","directly","."]
docstr: Ensures env is appropriate prior to launch.
  
  This method is called from `KernelProvisionerBase.pre_launch()` during the kernel's
  start sequence.
  
  NOTE: Subclasses should be sure to call super()._finalize_env(env)
docstr_tok: ["Ensures","env","is","appropriate","prior","to","launch",".","This","method","is","called","from","`","KernelProvisionerBase.pre_launch","(",")","`","during","the","kernel's","start","sequence",".","NOTE",":","Subclasses","should","be","sure","to","call","super","(",")","._finalize_env","(","env",")"]
code: def _finalize_env(self, env: Dict[str, str]) -> None:
      """
      Ensures env is appropriate prior to launch.
  
      This method is called from `KernelProvisionerBase.pre_launch()` during the kernel's
      start sequence.
  
      NOTE: Subclasses should be sure to call super()._finalize_env(env)
      """
      if (
          self.kernel_spec.language
          and self.kernel_spec.language.lower().startswith("python")
      ):
          # Don't allow PYTHONEXECUTABLE to be passed to kernel process.
          # If set, it can bork all the things.
          env.pop("PYTHONEXECUTABLE", None)
  
file_path: jupyter_client/jupyter_client/provisioning/provisioner_base.py
imports: import os
  from abc import ABC, ABCMeta, abstractmethod
  from typing import Any, Dict, List, Optional, Union
  from traitlets.config import Instance, LoggingConfigurable, Unicode
  from ..connect import KernelConnectionInfo
label_desc: Use image node_id 4 for calling the KernelProvisionerBase obj's underlying member method code with example usage: obj._finalize_env(env) without return types