#NEWLINE# def _get_shebang( self , encoding , post_interp = b'' , options = None ) : #NEWLINE# #INDENT# enquote = True #NEWLINE# if self . executable : #NEWLINE# #INDENT# executable = self . executable #NEWLINE# enquote = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not sysconfig . is_python_build ( ) ) : #NEWLINE# #INDENT# executable = get_executable ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if in_venv ( ) : #NEWLINE# #INDENT# executable = os . path . join ( sysconfig . get_path ( 'scripts' ) , ( 'python%s' % sysconfig . get_config_var ( 'EXE' ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# executable = os . path . join ( sysconfig . get_config_var ( 'BINDIR' ) , ( 'python%s%s' % ( sysconfig . get_config_var ( 'VERSION' ) , sysconfig . get_config_var ( 'EXE' ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if options : #NEWLINE# #INDENT# executable = self . _get_alternate_executable ( executable , options ) #NEWLINE# #UNINDENT# if ( enquote and ( ' ' in executable ) ) : #NEWLINE# #INDENT# executable = ( '"%s"' % executable ) #NEWLINE# #UNINDENT# executable = executable . encode ( 'utf-8' ) #NEWLINE# if ( ( sys . platform == 'cli' ) and ( '-X:Frames' not in post_interp ) and ( '-X:FullFrames' not in post_interp ) ) : #NEWLINE# #INDENT# post_interp += b' -X:Frames' #NEWLINE# #UNINDENT# shebang = ( ( ( b'#!' + executable ) + executable ) + b'\n' ) #NEWLINE# try : #NEWLINE# #INDENT# shebang . decode ( 'utf-8' ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# raise ValueError ( ( 'The shebang (%r) is not decodable from utf-8' % shebang ) ) #NEWLINE# #UNINDENT# if ( encoding != 'utf-8' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# shebang . decode ( encoding ) #NEWLINE# #UNINDENT# except UnicodeDecodeError : #NEWLINE# #INDENT# raise ValueError ( ( 'The shebang (%r) is not decodable from the script encoding (%r)' % ( shebang , encoding ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return shebang