You can generate a random value from 1 to 9 instead and shift it by one if it is bigger or equal to 2.
value = random.randint(1, 9)
move = value if value < 2 else value + 1
Mathematically, you want to select a random element in a set of 9 elements. All you need to do is to identify the element 3 with 2, 4 with 3 and so on. In probability, this is what we call a random variable.
A random variable is defined as a function that maps the outcomes of
unpredictable processes to numerical quantities.
This strategy of using a mapping is especially useful when your set is big and generating it would be costly, but the mapping rule is fairly simple.
Improvement:
It was pointed out by U9-Forward that in this case the mapping can be made slightly more efficient. It suffices to map 2 to 10.
value = random.randint(1, 9)
move = value if value != 2 else 10