This doesn't do what you think. Although `bytearray` doesn't appear until Python 2.6, python 2.x (x<6) is quite happy to define a function with a reference to the global bytearray. So the body of the `except:` never gets run, even on Python 2.5 and below.

Better:

```
try:
    bytearray
except:
    def bytearray( blah blah blah )...
```

Even better: Don't write this sort of stuff until you've actually tested it on earlier Python versions.