mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-07 07:02:53 +03:00
Fix return type in get_linux_type()
(#1025)
Summary: This function is expected to return a tuple of 3 elements. This doesn't happen when it fails opening the `/etc/os-release` file. X-link: https://github.com/facebook/watchman/pull/1025 Reviewed By: fanzeyi Differential Revision: D36736667 Pulled By: chadaustin fbshipit-source-id: a6839235d6c5ebb50267cd78f1c9590b2fb180d7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
eb2bfee04c
commit
7a2fe16c14
@@ -7,6 +7,7 @@ import platform
|
|||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
|
|
||||||
def is_windows() -> bool:
|
def is_windows() -> bool:
|
||||||
@@ -15,12 +16,12 @@ def is_windows() -> bool:
|
|||||||
return sys.platform.startswith("win")
|
return sys.platform.startswith("win")
|
||||||
|
|
||||||
|
|
||||||
def get_linux_type():
|
def get_linux_type() -> Tuple[Optional[str], Optional[str], Optional[str]]:
|
||||||
try:
|
try:
|
||||||
with open("/etc/os-release") as f:
|
with open("/etc/os-release") as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
return (None, None)
|
return (None, None, None)
|
||||||
|
|
||||||
os_vars = {}
|
os_vars = {}
|
||||||
for line in data.splitlines():
|
for line in data.splitlines():
|
||||||
|
Reference in New Issue
Block a user