this code works fine:

```
an_int = 5
a_bytes_big = an_int.to_bytes(2, 'big')
print(a_bytes_big)

```

but when i change an\_int to -5, i get the following error:

> 
> a\_bytes\_big = an\_int.to\_bytes(2, 'big')
> 
> 
> 

> 
> OverflowError: can't convert negative int to unsigned
> 
> 
> 

how can I convert signed int without getting error?