Update reg.py
Merge pull request #4923 from diluga/patch-1

Update reg.py