diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/python/py/patches/01-arcadia.patch | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/python/py/patches/01-arcadia.patch')
-rw-r--r-- | contrib/python/py/patches/01-arcadia.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/python/py/patches/01-arcadia.patch b/contrib/python/py/patches/01-arcadia.patch new file mode 100644 index 00000000000..5739c8689f6 --- /dev/null +++ b/contrib/python/py/patches/01-arcadia.patch @@ -0,0 +1,27 @@ +--- contrib/python/py/py/_vendored_packages/iniconfig/__init__.py (working tree) ++++ contrib/python/py/py/_vendored_packages/iniconfig/__init__.py (index) +@@ -1,6 +1,8 @@ + """ brain-dead simple parser for ini-style files. + (C) Ronny Pfannschmidt, Holger Krekel -- MIT licensed + """ ++import io ++ + __all__ = ['IniConfig', 'ParseError'] + + COMMENTCHARS = "#;" +@@ -49,7 +51,14 @@ + def __init__(self, path, data=None): + self.path = str(path) # convenience + if data is None: +- f = open(self.path) ++ if self.path.startswith('pkg:'): ++ import pkgutil ++ ++ _, package, resource = self.path.split(':') ++ content = pkgutil.get_data(package, resource) ++ f = io.StringIO(content.decode('utf-8')) ++ else: ++ f = open(self.path) + try: + tokens = self._parse(iter(f)) + finally: |