---
source: crates/ruff_linter/src/rules/pyupgrade/mod.rs
---
UP036 [*] Version block is outdated for minimum Python version
 --> UP036_5.py:3:4
  |
1 | import sys
2 |
3 | if sys.version_info < (3, 8):
  |    ^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 |     def a():
  |
help: Remove outdated version block
  |
2 |
  - if sys.version_info < (3, 8):
  -
  -     def a():
  -         if b:
  -             print(1)
  -         elif c:
  -             print(2)
  -         return None
  -
  - else:
  -     pass
3 + pass
4 |
  |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:18:4
   |
16 | import sys
17 |
18 | if sys.version_info < (3, 8):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^
19 |     pass
   |
help: Remove outdated version block
   |
17 |
   - if sys.version_info < (3, 8):
   -     pass
   -
   - else:
   -
   -     def a():
   -         if b:
   -             print(1)
   -         elif c:
   -             print(2)
   -         else:
   -             print(3)
   -         return None
18 + def a():
19 +     if b:
20 +         print(1)
21 +     elif c:
22 +         print(2)
23 +     else:
24 +         print(3)
25 +     return None
26 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:36:4
   |
35 | ## Errors
36 | if sys.version_info < (3, 12, 0):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 |     print()
   |
help: Remove outdated version block
   |
35 | ## Errors
   - if sys.version_info < (3, 12, 0):
   -     print()
36 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:39:4
   |
37 |     print()
38 |
39 | if sys.version_info <= (3, 12, 0):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 |     print()
   |
help: Remove outdated version block
   |
38 |
   - if sys.version_info <= (3, 12, 0):
   -     print()
39 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:42:4
   |
40 |     print()
41 |
42 | if sys.version_info < (3, 12, 11):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 |     print()
   |
help: Remove outdated version block
   |
41 |
   - if sys.version_info < (3, 12, 11):
   -     print()
42 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:45:4
   |
43 |     print()
44 |
45 | if sys.version_info < (3, 13, 0):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 |     print()
   |
help: Remove outdated version block
   |
44 |
   - if sys.version_info < (3, 13, 0):
   -     print()
45 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 Version specifier is invalid
  --> UP036_5.py:48:24
   |
46 |     print()
47 |
48 | if sys.version_info <= (3, 13, 100000):
   |                        ^^^^^^^^^^^^^^^
49 |     print()
   |

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:60:4
   |
58 |     print()
59 |
60 | if sys.version_info <= (3, 13, 0):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 |     print()
   |
help: Remove outdated version block
   |
59 |
   - if sys.version_info <= (3, 13, 0):
   -     print()
60 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:63:4
   |
61 |     print()
62 |
63 | if sys.version_info < (3, 13, 37):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64 |     print()
   |
help: Remove outdated version block
   |
62 |
   - if sys.version_info < (3, 13, 37):
   -     print()
63 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:66:4
   |
64 |     print()
65 |
66 | if sys.version_info <= (3, 13, 37):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67 |     print()
   |
help: Remove outdated version block
   |
65 |
   - if sys.version_info <= (3, 13, 37):
   -     print()
66 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:77:4
   |
75 | # https://github.com/astral-sh/ruff/issues/18165
76 |
77 | if sys.version_info.major >= 3:
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
78 |     print("3")
79 | else:
   |
help: Remove outdated version block
   |
76 |
   - if sys.version_info.major >= 3:
   -     print("3")
   - else:
   -     print("2")
77 + print("3")
78 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:82:4
   |
80 |     print("2")
81 |
82 | if sys.version_info.major > 3:
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^
83 |     print("3")
84 | else:
   |
help: Remove outdated version block
   |
81 |
   - if sys.version_info.major > 3:
   -     print("3")
   - else:
   -     print("2")
82 + print("2")
83 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:87:4
   |
85 |     print("2")
86 |
87 | if sys.version_info.major <= 3:
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
88 |     print("3")
89 | else:
   |
help: Remove outdated version block
   |
86 |
   - if sys.version_info.major <= 3:
   -     print("3")
   - else:
   -     print("2")
87 + print("3")
88 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:92:4
   |
90 |     print("2")
91 |
92 | if sys.version_info.major < 3:
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^
93 |     print("3")
94 | else:
   |
help: Remove outdated version block
   |
91 |
   - if sys.version_info.major < 3:
   -     print("3")
   - else:
   -     print("2")
92 + print("2")
93 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
  --> UP036_5.py:97:4
   |
95 |     print("2")
96 |
97 | if sys.version_info.major == 3:
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
98 |     print("3")
99 | else:
   |
help: Remove outdated version block
   |
96 |
   - if sys.version_info.major == 3:
   -     print("3")
   - else:
   -     print("2")
97 + print("3")
98 |
   |
note: This is an unsafe fix and may change runtime behavior

UP036 [*] Version block is outdated for minimum Python version
   --> UP036_5.py:109:4
    |
107 |     print(2)
108 |
109 | if sys.version_info.major > (3, 13):
    |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110 |     print(3)
111 | else:
    |
help: Remove outdated version block
    |
108 |
    - if sys.version_info.major > (3, 13):
    -     print(3)
    - else:
    -     print(2)
109 + print(3)
110 |
    |
note: This is an unsafe fix and may change runtime behavior
