Mercurial > p > roundup > code
comparison roundup/admin.py @ 5401:4cf48ff01e04
Python 3 preparation: replace raw_input uses.
The existing my_input in roundup/admin.py is moved to a new
roundup/anypy/my_input.py, which is then used in more places. Manual
patch.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 23:47:10 +0000 |
| parents | ac7fe3483206 |
| children | 3fa026621f69 |
comparison
equal
deleted
inserted
replaced
| 5400:2120f77554d5 | 5401:4cf48ff01e04 |
|---|---|
| 29 from roundup import __version__ as roundup_version | 29 from roundup import __version__ as roundup_version |
| 30 import roundup.instance | 30 import roundup.instance |
| 31 from roundup.configuration import CoreConfig, NoConfigError | 31 from roundup.configuration import CoreConfig, NoConfigError |
| 32 from roundup.i18n import _ | 32 from roundup.i18n import _ |
| 33 from roundup.exceptions import UsageError | 33 from roundup.exceptions import UsageError |
| 34 | 34 from roundup.anypy.my_input import my_input |
| 35 # Polyglot code | |
| 36 try: | |
| 37 my_input = raw_input | |
| 38 except NameError: | |
| 39 my_input = input | |
| 40 | 35 |
| 41 class CommandDict(UserDict.UserDict): | 36 class CommandDict(UserDict.UserDict): |
| 42 """Simple dictionary that lets us do lookups using partial keys. | 37 """Simple dictionary that lets us do lookups using partial keys. |
| 43 | 38 |
| 44 Original code submitted by Engelbert Gruber. | 39 Original code submitted by Engelbert Gruber. |
