@@ -1232,7 +1232,7 @@ public static object getnameinfo(CodeContext/*!*/ context, [NotNone] PythonTuple
12321232 + "Raises socket.error if no protocol number can be found."
12331233 ) ]
12341234 public static object getprotobyname ( CodeContext /*!*/ context , [ NotNone ] string protocolName ) {
1235- switch ( protocolName . ToLower ( ) ) {
1235+ switch ( protocolName . ToLowerInvariant ( ) ) {
12361236 case "ah" : return IPPROTO_AH ;
12371237 case "esp" : return IPPROTO_ESP ;
12381238 case "dstopts" : return IPPROTO_DSTOPTS ;
@@ -1266,7 +1266,7 @@ public static int getservbyname(CodeContext/*!*/ context, [NotNone] string servi
12661266 [ Documentation ( "" ) ]
12671267 public static int getservbyname ( CodeContext /*!*/ context , [ NotNone ] string serviceName , [ NotNone ] string protocolName ) {
12681268 if ( protocolName != null ) {
1269- protocolName = protocolName . ToLower ( ) ;
1269+ protocolName = protocolName . ToLowerInvariant ( ) ;
12701270 if ( protocolName != "udp" && protocolName != "tcp" )
12711271 throw PythonExceptions . CreateThrowable ( error , "service/proto not found" ) ;
12721272 }
@@ -1277,7 +1277,7 @@ public static int getservbyname(CodeContext/*!*/ context, [NotNone] string servi
12771277 } catch { }
12781278
12791279
1280- switch ( serviceName . ToLower ( ) ) {
1280+ switch ( serviceName . ToLowerInvariant ( ) ) {
12811281 case "echo" : return 7 ;
12821282 case "daytime" : return 13 ;
12831283 case "ftp-data" : return 20 ;
@@ -1327,7 +1327,7 @@ public static string getservbyport(CodeContext/*!*/ context, int port, [NotNone]
13271327 throw PythonOps . OverflowError ( "getservbyport: port must be 0-65535." ) ;
13281328
13291329 if ( protocolName != null ) {
1330- protocolName = protocolName . ToLower ( ) ;
1330+ protocolName = protocolName . ToLowerInvariant ( ) ;
13311331 if ( protocolName != "udp" && protocolName != "tcp" )
13321332 throw PythonExceptions . CreateThrowable ( error , "port/proto not found" ) ;
13331333 }
0 commit comments