import os

mylang = 'test'
family = 'wikipedia'


# Not defining any extra variables here at all since that causes pywikibot
# to issue a warning about potential misspellings
if os.path.exists(os.path.expanduser('~/user-config.py')):
    with open(os.path.expanduser('~/user-config.py'), 'r') as f:
        exec(
             compile(f.read(), os.path.expanduser('~/user-config.py'), 'exec'),
             globals())

# Things that should be non-easily-overridable
usernames['*']['*'] = os.environ['JPY_USER']

import os

mylang = 'test'
family = 'wikipedia'


custom_path = os.path.expanduser('~/user-config.py')
if os.path.exists(custom_path):
    with open(custom_path, 'r') as f:
        exec(compile(f.read(), custom_path, 'exec'), globals())

# Things that should be non-easily-overridable
usernames['*']['*'] = os.environ['JPY_USER']

Revert "Do not introduce extra variables"
Revert "Do not introduce extra variables"

Since the 'f' is considered an extra variable and introduces
a warning anyway :( Let's fix this the right way

This reverts commit a03de68fb772d859098327d0e54a219fe4507072.

  import os
  
  mylang = 'test'
  family = 'wikipedia'
  
  
- # Not defining any extra variables here at all since that causes pywikibot
- # to issue a warning about potential misspellings
- if os.path.exists(os.path.expanduser('~/user-config.py')):
+ custom_path = os.path.expanduser('~/user-config.py')
+ if os.path.exists(custom_path):
+     with open(custom_path, 'r') as f:
+         exec(compile(f.read(), custom_path, 'exec'), globals())
-     with open(os.path.expanduser('~/user-config.py'), 'r') as f:
-         exec(
-              compile(f.read(), os.path.expanduser('~/user-config.py'), 'exec'),
-              globals())
  
  # Things that should be non-easily-overridable
  usernames['*']['*'] = os.environ['JPY_USER']
  
Revert "Do not introduce extra variables"
## Code Before:
import os

mylang = 'test'
family = 'wikipedia'


# Not defining any extra variables here at all since that causes pywikibot
# to issue a warning about potential misspellings
if os.path.exists(os.path.expanduser('~/user-config.py')):
    with open(os.path.expanduser('~/user-config.py'), 'r') as f:
        exec(
             compile(f.read(), os.path.expanduser('~/user-config.py'), 'exec'),
             globals())

# Things that should be non-easily-overridable
usernames['*']['*'] = os.environ['JPY_USER']

## Instruction:
Revert "Do not introduce extra variables"
## Code After:
import os

mylang = 'test'
family = 'wikipedia'


custom_path = os.path.expanduser('~/user-config.py')
if os.path.exists(custom_path):
    with open(custom_path, 'r') as f:
        exec(compile(f.read(), custom_path, 'exec'), globals())

# Things that should be non-easily-overridable
usernames['*']['*'] = os.environ['JPY_USER']
