This repository was archived by the owner on Oct 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,13 +109,18 @@ class ServerlessPythonRequirements {
109109 }
110110 } ;
111111
112+ const isFunctionRuntimePython = args => {
113+ // If functionObj.runtime is undefined, python.
114+ if ( ! args [ 1 ] . functionObj || ! args [ 1 ] . functionObj . runtime ) {
115+ return true ;
116+ }
117+ return args [ 1 ] . functionObj . runtime . startsWith ( 'python' ) ;
118+ } ;
119+
112120 const before = ( ) => {
113- if (
114- arguments [ 1 ] . functionObj &&
115- arguments [ 1 ] . functionObj . runtime &&
116- ! arguments [ 1 ] . functionObj . runtime . startsWith ( 'python' )
117- )
121+ if ( ! isFunctionRuntimePython ( arguments ) ) {
118122 return ;
123+ }
119124 return BbPromise . bind ( this )
120125 . then ( pipfileToRequirements )
121126 . then ( addVendorHelper )
@@ -124,12 +129,9 @@ class ServerlessPythonRequirements {
124129 } ;
125130
126131 const after = ( ) => {
127- if (
128- arguments [ 1 ] . functionObj &&
129- arguments [ 1 ] . functionObj . runtime &&
130- ! arguments [ 1 ] . functionObj . runtime . startsWith ( 'python' )
131- )
132+ if ( ! isFunctionRuntimePython ( arguments ) ) {
132133 return ;
134+ }
133135 return BbPromise . bind ( this )
134136 . then ( removeVendorHelper )
135137 . then ( ( ) =>
You can’t perform that action at this time.
0 commit comments