Skip to content

Commit f0679ed

Browse files
authored
Merge pull request #195 from yilei/push_up_to_461698919
Push up to 461698919
2 parents 58ead8c + 31a6e49 commit f0679ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+176
-209
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).
88

99
Nothing notable unreleased.
1010

11+
## 1.2.0 (2022-07-18)
12+
13+
### Fixed
14+
15+
* Fixed a crash in Python 3.11 when `TempFileCleanup.SUCCESS` is used.
16+
1117
## 1.1.0 (2022-06-01)
1218

1319
* `Flag` instances now raise an error if used in a bool context. This prevents

absl/app.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ def main(argv):
2525
app.run(main)
2626
"""
2727

28-
from __future__ import absolute_import
29-
from __future__ import division
30-
from __future__ import print_function
31-
3228
import collections
3329
import errno
3430
import os

absl/command_name.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
"""A tiny stand alone library to change the kernel process name on Linux."""
1616

17-
from __future__ import absolute_import
18-
from __future__ import division
19-
from __future__ import print_function
20-
2117
import os
2218
import sys
2319

absl/flags/_defines.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
aliases defined at the package level instead.
1818
"""
1919

20-
from __future__ import absolute_import
21-
from __future__ import division
22-
from __future__ import print_function
23-
2420
import sys
2521
import types
2622

absl/flags/_defines.pyi

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,23 @@ def DEFINE_multi_enum(
576576
@overload
577577
def DEFINE_multi_enum_class(
578578
name: Text,
579-
default: Union[None, Iterable[_ET], _ET, Text],
579+
# This is separate from `Union[None, _ET, Text]` to avoid a Pytype issue
580+
# inferring the return value to FlagHolder[List[Union[_ET, enum.Enum]]]
581+
# when an iterable of concrete enum subclasses are used.
582+
default: Iterable[_ET],
583+
enum_class: Type[_ET],
584+
help: Text,
585+
flag_values: _flagvalues.FlagValues = ...,
586+
module_name: Optional[Text] = ...,
587+
*,
588+
required: Literal[True],
589+
**args: Any) -> _flagvalues.FlagHolder[List[_ET]]:
590+
...
591+
592+
@overload
593+
def DEFINE_multi_enum_class(
594+
name: Text,
595+
default: Union[None, _ET, Text],
580596
enum_class: Type[_ET],
581597
help: Text,
582598
flag_values: _flagvalues.FlagValues = ...,
@@ -601,7 +617,10 @@ def DEFINE_multi_enum_class(
601617
@overload
602618
def DEFINE_multi_enum_class(
603619
name: Text,
604-
default: Union[Iterable[_ET], _ET, Text],
620+
# This is separate from `Union[None, _ET, Text]` to avoid a Pytype issue
621+
# inferring the return value to FlagHolder[List[Union[_ET, enum.Enum]]]
622+
# when an iterable of concrete enum subclasses are used.
623+
default: Iterable[_ET],
605624
enum_class: Type[_ET],
606625
help: Text,
607626
flag_values: _flagvalues.FlagValues = ...,
@@ -610,6 +629,17 @@ def DEFINE_multi_enum_class(
610629
**args: Any) -> _flagvalues.FlagHolder[List[_ET]]:
611630
...
612631

632+
@overload
633+
def DEFINE_multi_enum_class(
634+
name: Text,
635+
default: Union[_ET, Text],
636+
enum_class: Type[_ET],
637+
help: Text,
638+
flag_values: _flagvalues.FlagValues = ...,
639+
module_name: Optional[Text] = ...,
640+
required: bool = ...,
641+
**args: Any) -> _flagvalues.FlagHolder[List[_ET]]:
642+
...
613643

614644

615645
def DEFINE_alias(

absl/flags/_exceptions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
aliases defined at the package level instead.
1919
"""
2020

21-
from __future__ import absolute_import
22-
from __future__ import division
23-
from __future__ import print_function
24-
2521
import sys
2622

2723
from absl.flags import _helpers

absl/flags/_helpers.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
"""Internal helper functions for Abseil Python flags library."""
1616

17-
from __future__ import absolute_import
18-
from __future__ import division
19-
from __future__ import print_function
20-
2117
import collections
2218
import os
2319
import re

absl/flags/_validators.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
aliases defined at the package level instead.
3333
"""
3434

35-
from __future__ import absolute_import
36-
from __future__ import division
37-
from __future__ import print_function
38-
3935
import warnings
4036

4137
from absl.flags import _exceptions

absl/flags/_validators_classes.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
private APIs.
1919
"""
2020

21-
from __future__ import absolute_import
22-
from __future__ import division
23-
from __future__ import print_function
24-
2521
from absl.flags import _exceptions
2622

2723

absl/flags/argparse_flags.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@
8888
3) argparse_flags supports `-h`; absl.app does not.
8989
"""
9090

91-
from __future__ import absolute_import
92-
from __future__ import division
93-
from __future__ import print_function
94-
9591
import argparse
9692
import sys
9793

0 commit comments

Comments
 (0)