]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- [bug] Fixed bug whereby directories inside of
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 20 May 2012 13:51:28 +0000 (09:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 20 May 2012 13:51:28 +0000 (09:51 -0400)
  the template directories, such as __pycache__
  on Pypy, would mistakenly be interpreted as
  files which are part of the template. #49

CHANGES
alembic/command.py

diff --git a/CHANGES b/CHANGES
index 093c5f64d1ccb2f463c6cd3c458c46561439ca9d..e075dcf10d68f5142f47cdda552c46129baac5bd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
   "alembic downgrade -1".  Courtesy 
   Atsushi Odagiri for this feature.
 
+- [bug] Fixed bug whereby directories inside of 
+  the template directories, such as __pycache__
+  on Pypy, would mistakenly be interpreted as 
+  files which are part of the template. #49
+
 0.3.2
 =====
 - [feature] Basic support for Oracle added, 
index ed7b8302cb68c46789641a61860dbbf3bb7ee1e8..98a054b508c18f3939d2910dadb3759f342c8f05 100644 (file)
@@ -39,20 +39,21 @@ def init(config, directory, template='generic'):
     script = ScriptDirectory(directory)
 
     for file_ in os.listdir(template_dir):
+        file_path = os.path.join(template_dir, file_)
         if file_ == 'alembic.ini.mako':
             config_file = os.path.abspath(config.config_file_name)
             if os.access(config_file, os.F_OK):
                 util.msg("File %s already exists, skipping" % config_file)
             else:
                 script._generate_template(
-                    os.path.join(template_dir, file_),
+                    file_path,
                     config_file,
                     script_location=directory
                 )
-        else:
+        elif os.path.isfile(file_path):
             output_file = os.path.join(directory, file_)
             script._copy_file(
-                os.path.join(template_dir, file_), 
+                file_path,
                 output_file
             )