class_docstr: Compatibility support for 'file' arguments of various load_*()
  functions.
class_docstr_tok: ["Compatibility","support","for","'file","'","arguments","of","various","load_","*","(",")","functions","."]
docstr: Gross hack to contort loader to deal w/ load_*()'s bad API.
docstr_tok: ["Gross","hack","to","contort","loader","to","deal","w\/","load_","*","(",")","'s","bad","API","."]
code: def get_data(self, path):
      """Gross hack to contort loader to deal w/ load_*()'s bad API."""
      if self.file and path == self.path:
          # The contract of get_data() requires us to return bytes. Reopen the
          # file in binary mode if needed.
          if not self.file.closed:
              file = self.file
              if "b" not in file.mode:
                  file.close()
          if self.file.closed:
              self.file = file = open(self.path, "rb")
  
          with file:
              return file.read()
      else:
          return super().get_data(path)
  
imports: from _imp import lock_held, acquire_lock, release_lock, get_frozen_object, is_frozen_package, init_frozen, is_builtin, is_frozen, _fix_co_filename, _frozen_module_names
  from importlib._bootstrap import _ERR_MSG, _exec, _load, _builtin_from_name
  from importlib._bootstrap_external import SourcelessFileLoader
  from importlib import machinery
  from importlib import util
  import importlib
  import os
  import sys
  import tokenize
  import types
  import warnings
label_desc: Use image node_id 2 for calling the _HackedGetData obj's underlying member method code with example usage: obj.get_data(path) and returns: super, file