This way the code snippet would look something like this:

```
    # Get major tick label size (assumes that's all we really care about!)
    sizes = [tick.get_fontsize() for tick in axis.get_ticklabels()]
    if props['nticks'] > 0 and sizes[1:] == sizes[:-1]:
        props['fontsize'] = sizes[0]
    else:
        props['fontsize'] = None
```