diff --git a/master/buildbot/steps/source/svn.py b/master/buildbot/steps/source/svn.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/steps/source/svn.py
+++ b/master/buildbot/steps/source/svn.py
@@ -160,8 +160,8 @@ class SVN(Source):
             checkout_dir = self.build.path_module.join(
                 checkout_dir, self.codebase)
         # temporarily set workdir = checkout_dir and do an incremental checkout
+        old_workdir = self.workdir
         try:
-            old_workdir = self.workdir
             self.workdir = checkout_dir
             yield self.mode_incremental()
         finally:
diff --git a/master/buildbot/www/ldapuserinfo.py b/master/buildbot/www/ldapuserinfo.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/www/ldapuserinfo.py
+++ b/master/buildbot/www/ldapuserinfo.py
@@ -24,6 +24,7 @@
 # `unicode` and `raw_*` attributes for `bytes`.
 
 
+import importlib
 from urllib.parse import urlparse
 
 from twisted.internet import threads
@@ -36,7 +37,6 @@ from buildbot.www import avatar
 try:
     import ldap3
 except ImportError:
-    import importlib
     ldap3 = None
Address used-before-assignment pylint warnings